Hey people,
Before I write this post I would just like to mention that I have a lack of knowledge in the area of Physics and generally anything else which comes in the form of COS or SIN. I got an 'E' in Math's and well most of the things I need to know were never actually covered at school, at my level at least
so I tend to get into a bit of a pickle when it comes to the more interesting things.
Well thats my whining and attempt at explaining myself out of the way ..I will continue!
I was just playing with a sprite trying to create the effect of a bouncing ball,. I have managed to create something which resembles the effect. However the code is bad.
I am using just two variables 'PositionY#' and 'Velocity#' - I am not sure where to use a gravity variable and even energy/gained/lost etc.
In short.. I need a little bit of help in the way I should go about making a simple bounce motion including effects of gravity, velocity and energy expenditure of the bounce and whatnot. I just keep getting in a mess when thinking about the physical side of things and then trying it in code. I either get a ball flying all over the screen or it will sit still etc etc,.
The code I started with should be below,.. eek. I noticed whilst looking at other code that most people use at least six million variables and lots of interesting gosub's. Also I had problems with getting the ball to settle once it should have stopped bouncing. My PositionY and Velocity variables were having a battle over the position of the sprite.
I solved the problem of the squiggly ball by adding a value to my ball's position :
sprite 1,320,PositionY#+0.999,1
I figured that out accidently whilst adding another sprite to bounce at a different speed. That is what led me to believe whatever I was doing was bad and wrong and that I should probably come and spam the forums with my apparently pointless life story on the matter! arf.diddle >.<
I think i'll shut up now. I hope someone can help me understand what I need to do to create an effective bouncing ball. Thanks very much for your time.
Regards
Ash.
```````
P.S - I havnt had much luck in finding a complete tutorial on the fundamentals of trigonometry and other such goodies. If anyone has a link or an idea where I can brush up/learn some general math stuff.
.Arf..