Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: leofox on September 24, 2006, 06:33:00 am

Title: GRAVLAB II
Post by: leofox on September 24, 2006, 06:33:00 am
Gravlab was a little test program i made in TI-basic, a demo of a falling and bouncing ball. For my senior assignment (or w/e you call that in English), i decided to remake it in ASM/Basic.
In essence, it's now a physically accurate simulation of a ball falling in vacuum. Features i plan to add are multiple objects, friction, realistic collision , shooting the ball (giving it a certain start velocity) and maybe even wind.
I don't plan to use it in a game, it's main purpose is demonstration in physics class, clarifying gravity. Similar programs are already used in physics class, but usually the teacher does the settings and the students only watch. Gravlab II would allow every student to figure it out by themself.

Basic/ASM means that the main menu and user input is written in TI Basic, but the actual graphical simulation (where accuracy and speed are so very much needed) is 100% Assembly without any rom calls in the main loop.

a screenie:
user posted image
Values here are acceleration of $00,$00,$01 and frameskip of $80.
In human, that means the acceleration is 1/65536th of a pixel, but it only draws one in 128 frames (so it runs at a decent speed). It's kinda jumpy now, but that's because most of the speed is spent on calculating. Higher acceleration is recommended, so you can lower the frameskip for a smoother picture. You lose a bit of accuracy though, but that shouldn't matter because the speed barely goes above 1pixel anyway (the problem with these is that if your speed is too high, objects will fall through each other).
Title: GRAVLAB II
Post by: DJ Omnimaga on September 24, 2006, 08:15:00 am
wow nice I experienced ball bouncing a while ago in BASIC, however I dont have the program anymore I had it bounce around and I could make it move right or left, maybe some kind of games could be made with it? Like where you have to get a bouncing ball through several levels without hitting vertical walls?
Title: GRAVLAB II
Post by: leofox on September 24, 2006, 08:10:00 pm
You can set the values at the beginning, so i could make a little bonus game where you have to guide the ball through a series of levels by choosing the right values.
Title: GRAVLAB II
Post by: DJ Omnimaga on September 25, 2006, 02:40:00 am
aaah that sound cool, it would be fun i think, or some kind of pong game ^^
Title: GRAVLAB II
Post by: elfprince13 on September 25, 2006, 02:54:00 am
this looks kinda cool, are you gonna have walls and stuff like that?
Title: GRAVLAB II
Post by: leofox on September 26, 2006, 02:32:00 am
Now it just checks for a value to determine a horizontal line, but i want to change that so it pixel checks. That might give trouble with realistic collision of other balls though.
Title: GRAVLAB II
Post by: DJ Omnimaga on September 26, 2006, 04:34:00 am
ouch considering the ball is circular >.< that may be one though thing...
Title: GRAVLAB II
Post by: leofox on October 03, 2006, 06:36:00 am
oh god i didnt even think of that one...
Title: GRAVLAB II
Post by: Netham45 on October 03, 2006, 07:48:00 am
Maby you could use octagons? still round, but with flat sides.
Title: GRAVLAB II
Post by: DJ Omnimaga on October 04, 2006, 10:56:00 am
well if the ball is small i think hit detection shouldnt be very complex. but if the ball is big(ger) it may be harder to calculate angle