CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: MateoConLechuga on October 15, 2016, 11:45:11 PM

Title: Bounce [TI84+CE]
Post by: MateoConLechuga on October 15, 2016, 11:45:11 PM
This is a simple program I made today that can bounce hundreds of balls around the screen and has the ability to add, remove, and clear and change the graphics of. It is a pretty entertaining program, and the source code is something you should really peruse if you wish to take a look at how to use interrupts and the keypad in your C programs. Enjoy :)

Download: BounceCE (https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/graphics/Bounce.zip)

(http://myimages.wikidot.com/local--files/start/balls.gif)

[on]     - Quits the program
[clear]  - Clears the screen
[del]    - Delete latest ball
[+]      - Shows number of balls
[-]      - Switches between filled and outline
[enter]  - Toggles background color
Title: Re: Bounce [TI84+CE]
Post by: p2 on October 16, 2016, 07:10:11 PM
each time they hit a border they should get a bit more transparent  so balls tend to disappear after a while ^^
How many balls can teh calc handle without slowing down? :) Could you att a balls-counter as well as a fps-counter? :)

I loke those bouncing balls  :love:
Title: Re: Bounce [TI84+CE]
Post by: kotu on October 17, 2016, 10:23:12 PM
Quote from: p2 on October 16, 2016, 07:10:11 PM
each time they hit a border they should get a bit more transparent  so balls tend to disappear after a while ^^

you would need to use 16 bit color for that so then you won't be able to use double buffering so would get flicker.  :'(

*edit*
want the download for this Mateo lol
Title: Re: Bounce [TI84+CE]
Post by: p2 on October 17, 2016, 10:26:30 PM
aaah I see okey. Then better NOT adding anything ^^ Nothing worse than this annoying screen flickering...  :ninja:
One day I need to get such a calculator, too... :P nSphire CX CAS won't do it I guess... :/

*NOOO I did my 500th post here instead of in the posting milestones threat... :'( stupid me <_<
Title: Re: Bounce [TI84+CE]
Post by: kotu on October 17, 2016, 10:54:00 PM
Quote from: kotu on October 17, 2016, 10:23:12 PM
want the download for this Mateo lol
found the suspicious download lol
Title: Re: Bounce [TI84+CE]
Post by: c4ooo on October 17, 2016, 11:03:32 PM
Quote from: p2 on October 17, 2016, 10:26:30 PM
aaah I see okey. Then better NOT adding anything ^^ Nothing worse than this annoying screen flickering...  :ninja:
One day I need to get such a calculator, too... :P nSphire CX CAS won't do it I guess... :/

*NOOO I did my 500th post here instead of in the posting milestones threat... :'( stupid me <_<
Shhh you can pretend like this is actually not your 502nd post :ninja:
Also crap i missed my 700th post >_>
Title: Re: Bounce [TI84+CE]
Post by: kotu on October 19, 2016, 02:58:04 AM
Ok cool

Mateo, would you agree with me the use of interrupts in this manner is an 'advanced' technique and should be treated with caution??

In this case, in the for(i=0; i<num_balls; i++) { loop, i could actually become equal to num_balls or greater than it because of the interrupt. In this particular example, everything is ok, however, things might not be the case in other examples.

Agreed?
Title: Re: Bounce
Post by: Dream of Omnimaga on October 19, 2016, 03:22:59 AM
THis looks cool. I'll give this a try when I have a chance. I am definitively curious about the on-calc speed. :)

If you are using shapes instead of sprites, would the speed be similar with sprites?
Title: Re: Bounce
Post by: MateoConLechuga on October 19, 2016, 03:28:00 AM
Quote from: DJ Omnimaga on October 19, 2016, 03:22:59 AMIf you are using shapes instead of sprites, would the speed be similar with sprites?
Speed would probably be at least a quarter faster with sprites :) Circles kind of take a while to draw.
Title: Re: Bounce
Post by: Dream of Omnimaga on October 19, 2016, 03:32:28 AM
Hm I see. That's good then I guess, especially if someone plans to port nKaruga to the CE or something :P