/    Sign up×
Community /Pin to ProfileBookmark

[Game] Leaving a trail on the screen

I’d like to make a game-like interactive animation with javascript. A car of some sort that will be able to move in all directions is something i have no troubles with. But on top of that i would like to add a trail that this “car” of mine would leave behind it.

Keeping in mind that the car is able to move in all direction (by which i mean any angle, not just up-down-left-right), how would i make the parts of the screen that the car “ran over” to have a different color or something, and preferably leaving the option of calculating the surface area of the trail?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@jackacohenJan 03.2011 — If I were doing this I'd code it into the script that moved the "car", using the same variables.

I've written something like this using jsDraw.js, but an answer I gave in terms of that code would not be meaningful if you're not using that package.

So, how are you animating the car?
×

Success!

Help @3Nex spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...