Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: lkj 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 (http://www.omnimaga.org/index.php?action=dlattach;topic=12607.0;attach=13144)
-
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:
-
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.
-
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).
-
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.
-
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.
-
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)
(http://img.removedfromgame.com/imgs/lineError1.jpg)
and maybe it might be more useful to use up and down instread of left and right, it will be more intuïtive..
-
ill have to try this soon... 200th post!
-
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.
-
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)
-
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.
-
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.
-
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
-
Woa This will be very cool!/me downloads
-
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?
-
Should I make the framerate constant or should I leave it as it is, sometimes 50 fps and sometimes 62?
-
depends if it screws the physics.
-
I just noticed it would be much more difficult than I thought, so I'll leave it as it is.
I wonder if you will add variable platform heights, with hills and stuff, along with holes?
I think I'll first add animations, since I would have to rewrite almost everything to implement your suggestions.
-
No need for two separate posts so close together, so I combined them. :) For future reference, you can use the "modify" button if you just have a quick thought to add.
-
Sorry, I didn't notice I doubleposted.
I read that just moving the screen for scrolling and only drawing the new pixels would be faster than redrawing everything, but would I have to memcpy every line or is there a faster way?
-
It's the good way, but use memov instead of memcpy.
-
Am I right that I need two buffers for this, one for everything that I want to display and one for the parts of the screen that get shifted.
-
I implemented the memmove scrolling and it's a bit slower, I think because it needs two buffers and has to copy both every frame :(
The old method got 1800 fps and the new one only 1450 in the emulator.
Edit: by only copying the needed parts of the buffer I get 1600 fps
-
After some months without calc programming I finally returned and continued this project ;D
It now has an animated stick figure, but for now only when running (because I'm not very talented and slow in drawing). It probably rather looks like a walking figure than like a running one :-\
And I created a moving screenshot with Jonius7's tutorial (http://ourl.ca/6943) ;)
-
Glad to see this progressing again. :)
-
Wow looks really nice! I'm going to try it out right now
-
This will probably be the last update on this project because it's more or less complete and I'm more interested in new ideas.
I don't remember everything I've changed, but the most important thing is that it now generates a different level every time you run it.
-
Nice little project! Good work! :)
-
Nice job. :)