We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello guys, i would really appreciate if u make me a code with circles (instead of spiders) of the move of the spiders of this video:
It starts at min 1:30
I mean, i think it only create lets say 8 enemies. And the 2nd one is created when the first one has moved lets say 100 pixels.
The 3rd one is created when the 2nd one has moved again 100 pixels, and so on.
But i dont know how can i do that on processing. Please, help me
Answers
Have you made already made the code to make a single circle begin, move, and end? Can you share what you have so far?
All balls can have same speed and start at same time
Just give them different x values far outside the screen
No, they all start on the same value at X.
and i dont use circles, i use PImages, but i wont copy that cuz u need to have the image and so on. Just make a single circle or what ever
My hint was to use different x values so they appear after another
Other approach than yours
ok. I have already done that. It isnt what i want. have u seen the video? cuz on the video they all start on the same spot
I got an idea, but idk if it will work.
I do actually do this:
But it is a mess when they all are created.
So my is to instead of checking the X value on elemnts from a List, making a Queue, and when an enemy reaches left egde, remove it from the queue and add it to the top, and check the X value always from the top element
Stop starting new threads
Of course I saw the video
My advice is still valid
Just make different y values and x outside the screen
They just fly inside the screen from outside the screen
Nothing to do with lifo and fifo
i dont start any thread xDD
wait what? u can have a draw on classes?
Uuuh that not exactly what i want. I got this, but this is a mess when all the balls are created:
And the run makes the show (render) and update(moving, but only checking one edge, for now)
ah okey, ur draw from the class is not the draw from processing, ok ok ^^
Correct:
myObject.draw()
is not the same thing asdraw()
-- it isn't a hook/callback and it does not get automatically called by Processing every frame. It is generally a function for rendering that specific object. To avoid confusion you could call it something else, likerender()
.ok ok ty ^^