I think you could add some intractability so that you can do something instead of watching it, eg being able to throw the object
What you have done here is implement acceleration. Instead you can actually use the sprite’s acceleration to be gravity.
What you have done here is create a bounce with some level of slowing down. What you really want is some way to use an event.
Consider this
What we have done is use the ay (acceleration y) to set up our gravity.
With gravity we can start our ball with a vy of 0 and let gravity do the work.
We can also set up a wall along the bottom of our tilemap. When we touch the wall we can bounce by setting the vy to -vy and at the same time remove some of the velocity for both x and y.
By using an event instead of polling (looping forever watching for something to happen), we save lots of computing power. That makes our simulation a bit smoother.
Last post 3 years ago?? Welcome back!!
Maybe you could set the velocity to 0 once it’s low enough so that the numbers don’t go crazy once it stops moving
Your off to a good start!
oh sorry I completely forgot I made this post thanks for the help
this should help and also rn Im working on animations based of directions but this code you sent should help with the ball clipping threw the floor
I added some stuff with this code try using arrow keys now fyi
The comment says “You can add left and right here. This is just the bottom. You should probably add the top.” and it is simple addon but it fixes the bottom bounce.
This is the code
I do not understand, the walls work fine
I appreciate the gesture but I don’t think there is much to fix.