Author Topic: Line Runner for Nspire  (Read 19613 times)

0 Members and 1 Guest are viewing this topic.

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Line Runner for Nspire
« on: February 12, 2012, 02:28:45 pm »
I'm writing a clone of the iphone game Line Runner. It works but I'll need to implement and improve a lot of things, for example better graphics. The CX isn't supported yet because I don't have one to test and I didn't have time to read everything about how to use the ndless functions for this.

Does anyone know why the nspire emulator gets a totally different speed if I use idle()? And even more different if I let the fast timer run? On calc it's too fast and on emulator it's so slow you can't play.

newest version
« Last Edit: July 05, 2012, 01:16:30 pm by lkj »

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Line Runner for Nspire
« Reply #1 on: February 12, 2012, 05:21:06 pm »
Now it should work on the CX, but I'm not sure. Am I right that I can't use the emulator to emulate a cx without boot1?

Has anyone got an idea how to make the game blur less on screens of classic nspires?

Here's also the source:

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Line Runner for Nspire
« Reply #2 on: February 12, 2012, 05:50:49 pm »
The only way to make it blur less on the old Nspires is to reduce the framerate to under 15 fps. There,s no way to remove the blur itself and framerate has to be reduced to keep the game playable.

I should give this a try to see if it works.

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Line Runner for Nspire
« Reply #3 on: February 13, 2012, 01:02:02 am »
I'll try to reduce the framerate when I have time.

I forgot to write what the controls are: left for jump, right for the other thing (don't know the word).

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Line Runner for Nspire
« Reply #4 on: February 13, 2012, 02:08:25 am »
Quote
Am I right that I can't use the emulator to emulate a cx without boot1?
Right, TI found it smart to make the CX (and probably CM) series' boot2 not entirely executable after decompression.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Line Runner for Nspire
« Reply #5 on: February 13, 2012, 08:16:17 am »
lkj, you should post an animated screen shot to promote your program.

Does anyone know why the nspire emulator gets a totally different speed if I use idle()? And even more different if I let the fast timer run? On calc it's too fast and on emulator it's so slow you can't play.

idle() puts the CPU into idle mode until the next interrupt. If you change to timer's frequency, idle()'s execution time will change.
But with throttle mode on, the experience should be the same on nspire_emu and on real hardware. Maybe you should post the source code if you want someone to review the code to check what could be wrong.
Ndless.me with the finest TI-Nspire programs

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Line Runner for Nspire
« Reply #6 on: February 13, 2012, 01:24:30 pm »
it's not finished right? it only shows 3 blocks to jump over, and 1 to get under... then there's nothing

oh, and there's an error each time i exit the program, here's a pic: (cx cas)


and maybe it might be more useful to use up and down instread of left and right, it will be more intuïtive..

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Line Runner for Nspire
« Reply #7 on: February 13, 2012, 04:21:38 pm »
ill have to try this soon... 200th post!
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Line Runner for Nspire
« Reply #8 on: February 13, 2012, 04:45:07 pm »
Ok, new version:
  • -Up and down are also supported. Do you think I should remove left and right?
  • -I've put a lcd_incolor() at the end of the code, maybe this fixes Nick's issue
  • -The level is more varied (I think that the only 2 blocks problem was that there was only empty space for a long time after, since it was randomly generated)
  • -Changed rolling
  • -Added simple score

idle() puts the CPU into idle mode until the next interrupt. If you change to timer's frequency, idle()'s execution time will change.
But with throttle mode on, the experience should be the same on nspire_emu and on real hardware. Maybe you should post the source code if you want someone to review the code to check what could be wrong.

It was the same experience with throttle mode off, else it was far too slow. I think now it's better, but I can't test it on my calc because the batteries are empty. Is it a good idea to use set_cpu_speed(CPU_SPEED_90MHZ) to slow it down (I restore it at the end)?

The source code is included in the zip file. But it's not very well commented.

Do I have to use lcd_incolor() at the end if I have lcd_ingray() at the beginning?

Edit: It should be less blurry now since I skip half of the frames on monochrome nspires.
« Last Edit: February 13, 2012, 05:12:28 pm by lkj »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Line Runner for Nspire
« Reply #9 on: February 13, 2012, 07:38:43 pm »
Hmm, shouldn't set_cpu_speed be deprecated on the CX or something since the values used and the method of setting are different? The set_cpu_speed is probably what causes weird problems upon exit (because CPU speed changes on the CX, unless done in a specific way, only take effect after the program exits)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Line Runner for Nspire
« Reply #10 on: February 13, 2012, 08:13:42 pm »
Wow the exit glitch was quite scary O.O (see video attached to post below). The game seems kinda nice so far, though. More speed like in The Impossible Game (I lost) would be nice, though.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Line Runner for Nspire
« Reply #11 on: February 14, 2012, 03:55:12 am »
Do I have to use lcd_incolor() at the end if I have lcd_ingray() at the beginning?

No, it's not really needed.

Hmm, shouldn't set_cpu_speed be deprecated on the CX or something since the values used and the method of setting are different?

It's indeed deprecated.
Ndless.me with the finest TI-Nspire programs

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Line Runner for Nspire
« Reply #12 on: February 14, 2012, 05:41:33 pm »
I think I've fixed everything except the blur in this new version:
- removed set_cpu_speed()
- removed direct use of timers
- changed rolling again
- faster, more difficult
- getting faster when you reach certain points

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Line Runner for Nspire
« Reply #13 on: February 15, 2012, 03:33:14 pm »
Woa This will be very cool!
* hellninjas downloads

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Line Runner for Nspire
« Reply #14 on: February 15, 2012, 11:46:01 pm »
I don,t think you can do anything about the blur. Blame TI for that.

I wonder if you will add variable platform heights, with hills and stuff, along with holes?