Hello All!
(For those not bothered with text, the question is at bottom.)
Okay, so, I'm trying to make a puzzle game called firefly. In which, the player controlls a jar using the mouse to catch the bugs around a forest like environment. So, naturally, the bugs move around in a sinewave like movement.
I have a fairly good understanding of how that works (tinkered with an example a while back), but I want to make it to switch between x and y movements smoothly. Allow me to explain with a picture aid.
In this figure, the basic movment pattern for the bugs is number 1. This is very easy to pull off, and they can appear from anywhere on the sides, and go either left or right.
The second movent is when the bugs start climbing up and down the tree. Again, the up and down isn't hard. Its going from the horizontal movent to the vertical movent that I find difficult. Then, in movent number 3, they switch to horizontal again. And in movent number 4, back to vertical movent. Then, under certain conditions, the pattern is reversed and the bug continues along the screen, or finds a new tree.
It gets further complicated in movents 5 and 6. This is because two fireflies are present. In movent 5, they are swirling around one another. In movent 6, they go down the tree, and part ways. One of them however, bounces on the ground and leaves pockets of glow worms.
So, what I want to know is, how do i get it to go from the horizontal, to vertical, and back again? I want it to be a smooth transition. Plus, I would like to know how to accomplish movement number 5. Can anyone help?
Edited by the Author.
Edited by the Author.
All platforming problems can be mostly solved here:
Lol, what is it with people and sine wave movements? I feel pity for the cosine wave movements
So, um, what was your question again? You seem to imply that you know how to do it but it's complicated. But that means you already know how to do it
Switching between x and y movements is only a matter of using flags.
Flag 0 on: x movement
Flag 1 on: y movement
Want to change the movement, just switch one off and the other on.
Well, bugs don't really move in a sine wave, anyway. Why not make a random movement instead? Like
y=y+Random(3)-Random(3), x=x+3
. It will produce a horizontal movement, where most of the movement will center around the middle, with a few occasional ones to the side.
Edited by an Administrator.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
I tend to make long posts because whenever noobs ask for help. They do so in cryptic, short phrases without explaining they're problem. I'll have to try that though, thanks anyways. Any idea how to get two of them to rotate around each other though? That's the problem i have i think. Thanks again.
All platforming problems can be mostly solved here: