Just a bit ago i learned about how cool waves are and i figured that i should share it with you guys! So here it is:
where h is height and u is oscillation speed (up and down)
x is the x and y is the y
oh! and dont forget to update the x or it wont move!
the sample code:
local blimp = Bitmap.new(Texture.new("images/blimp.png"))
There you go, when you put it all together you get a cool sine wave effect that is fun to mess around with.
cosine is almost the same, but the wobbles are in a different spot- try it out.
Now, you may ask, what does this have to do with app dev?
Sine waves are (or can be) used in many games, whenever you see something wobble while moving forward!
I will post here when i find out more useful line formulas!
Feel free to post what you did with sine waves.
Note:you will have to add the image manually in gideros. make a folder called images (in gideros) and put blimp.png (findable in the .zip) in it.
The sample game:
“ The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. ” - Tom Cargill