This site requires JavaScript, please enable it in your browser!
Greenfoot back
Wolfieee
Wolfieee wrote ...

2015/3/17

Path of the object

Wolfieee Wolfieee

2015/3/17

#
Hello guys, I am making a programme where I am controlling the actor with keys LEFT and RIGHT, it is moving still. But I have a problem, how to draw a path behind this object? https://youtu.be/cpCkBfzepNQ?t=6s ...Here's the link what I am thinking of. Simple dot drawing a line behind itself. I am kinda new in GreenFoot. I tried a lot, but everytime I stucked into massive lags and there was no conclusion. Is there any easy way how to do that? Every help is appreciated. Thank you :)
danpost danpost

2015/3/17

#
Seeing what is happening is not the same as looking at HOW it is happening. This is more important, especially when lag is involved. You should show the code being used to draw (or put) the dots or lines behind the actor. Use the 'code' link below the 'Post a reply' content box to insert code into your posts. The two main ways of producing trails are as follows: (1) draw the trail on the background of the world; this is okay if the trail is permanent and does not fade away; my Crayon Babies: A World Changing Demo scenario has an example of this; (2) create actors that have the images for the trail and add them into the world; this is best for when the trail is not permanent -- make sure the trail actors remove themselves when fade or the specific time or act cycles has elapsed;; using actors for permanent trails or not having them removed causes an over-abundance of actors which produces lag; the greenfoot video tutorials (Joy of Code #24) on creating smoke would be similar to this (go to the Documentation page for a link). In fact, it mentions a previous tutorial video on fading balls that remove themselves, which is even closer to what you would use (Joy of Code #23).
You need to login to post a reply.