* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Bounce  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 205
  • Post Rating Ratio: +18/-1
    • View Profile
Bounce
« 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



Code: [Select]
[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
« Last Edit: October 17, 2016, 11:02:17 pm by MateoConLechuga »



Offline p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 1903
  • Post Rating Ratio: +7/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
    • View Profile
  • Gender: Male
Re: Bounce
« Reply #1 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:
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline kotu

  • Walrus Dehumidifier
  • Super User
  • Join Date: Aug 2016
  • Location: Bristol, UK
  • Posts: 776
  • Post Rating Ratio: +6/-5
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @djkotu
    • View Profile
    • futurerave.uk
  • Gender: Male
Re: Bounce
« Reply #2 on: October 17, 2016, 10:23:12 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
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony Playstation 3

Offline p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 1903
  • Post Rating Ratio: +7/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
    • View Profile
  • Gender: Male
Re: Bounce
« Reply #3 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 <_<
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline kotu

  • Walrus Dehumidifier
  • Super User
  • Join Date: Aug 2016
  • Location: Bristol, UK
  • Posts: 776
  • Post Rating Ratio: +6/-5
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @djkotu
    • View Profile
    • futurerave.uk
  • Gender: Male
Re: Bounce
« Reply #4 on: October 17, 2016, 10:54:00 pm »
want the download for this Mateo lol
found the suspicious download lol
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony Playstation 3

Offline c4ooo

  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 836
  • Post Rating Ratio: +7/-2
  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    • View Profile
  • Gender: Male
Re: Bounce
« Reply #5 on: October 17, 2016, 11:03:32 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 >_>
??? ??? ???

Offline kotu

  • Walrus Dehumidifier
  • Super User
  • Join Date: Aug 2016
  • Location: Bristol, UK
  • Posts: 776
  • Post Rating Ratio: +6/-5
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @djkotu
    • View Profile
    • futurerave.uk
  • Gender: Male
Re: Bounce
« Reply #6 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?
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony Playstation 3

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17500
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Bounce
« Reply #7 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?
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 205
  • Post Rating Ratio: +18/-1
    • View Profile
Re: Bounce
« Reply #8 on: October 19, 2016, 03:28:00 am »
If 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.

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17500
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Bounce
« Reply #9 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
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games