Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: pbfy0 on March 29, 2014, 12:55:02 pm

Title: 2048 for Nspire
Post by: pbfy0 on March 29, 2014, 12:55:02 pm
Since no one else has, I decided to take the plunge and write a version of 2048 (http://gabrielecirulli.github.io/2048/) in Nspire lua. It still has a few bugs, but it should be playable and fun

Controls: Arrow keys or 8/6/2/4 to move tiles. Enter to reset after winning or losing, or ctrl-del to force a reset during a game. Use any letter to change to a different save slot, to allow multiple games at the same time.
(http://img.ourl.ca/2048_3.png)
New: Now has graphics based on NBonaparte's modification
Title: Re: 2048 for Nspire
Post by: nspireguy on March 29, 2014, 06:47:34 pm
This looks really good!
Good job.
Title: Re: 2048 for Nspire
Post by: LDStudios on March 29, 2014, 07:23:51 pm
I was working on a 2048, but since is yours is done, I guess I'll make something else :P
Anyways, for me the numbers are displaying about 50 pixels above the squares instead of  inside them.
I edited all the y values for the numbers 45 pixels down and it worked fine.
Title: Re: 2048 for Nspire
Post by: jiagejiage on March 30, 2014, 05:42:28 am
it didn't support os3.1...sad news
Title: Re: 2048 for Nspire
Post by: kevinkore3 on March 30, 2014, 03:10:38 pm
Yay, addicting puzzles for the nspire.
By the way, Ndless 3.6 has come out, so you don't need os 3.1 anymore.
Title: Re: 2048 for Nspire
Post by: LDStudios on March 30, 2014, 03:24:32 pm
Yay, addicting puzzles for the nspire.
By the way, Ndless 3.6 has come out, so you don't need os 3.1 anymore.

3.1 Takes up less space and can load faster. Also, some people don't like the new calculator page appearance in 3.6. Yes, 3.1 has become more obsolete, but it isn't pointless.
Title: Re: 2048 for Nspire
Post by: Streetwalrus on March 30, 2014, 03:26:28 pm
Neither right nor wrong for Ndless 3.6. There are still reasons to use OS 3.1. ;)
And I was ninja'd again. ._.
Title: Re: 2048 for Nspire
Post by: kevinkore3 on March 30, 2014, 05:09:23 pm
3.1 takes up like a megabyte less... not a big difference. 3.6 can graph and analyze conics, while in 3.1 you can only do them with parametric equations, which is kind of hard. At any rate, their isn't a big difference between the OSes. Don't know why anyone would prefer 3.1 over 3.6 by that much.
Title: Re: 2048 for Nspire
Post by: Streetwalrus on March 30, 2014, 05:14:17 pm
I have a non CAS CX in which I Nlaunch a CAS OS. It is not possible with 3.6.
Title: Re: 2048 for Nspire
Post by: Nspirecas on March 31, 2014, 04:38:47 pm
Good game!
Can you add the 8,4,6 and 2 buttons for directions?
and if you could add a score
thank you very much
Title: Re: 2048 for Nspire
Post by: NBonaparte on March 31, 2014, 06:32:19 pm
The keypad should work already.

I tried adding a score, but it didn't work perfectly (if there was a pair and they were not combined, you could cheat by pressing a direction repeatedly).
I've also implemented a highscore and restart button, but the button only works until one wins or loses (if one restarts the game after losing, restarting doesn't work). It might have to do with the "try again" button which I made to appear at the "game over" screen.
I've also been thinking to add animations but it might be too much for now.
Title: Re: 2048 for Nspire
Post by: kevinkore3 on March 31, 2014, 07:42:51 pm
Does anyone have an old version? The animations are nice but half the time I spam 10 keys a second so it gets a bit confusing :S
Title: Re: 2048 for Nspire
Post by: NBonaparte on March 31, 2014, 07:57:43 pm
I have the original vanilla version (attached).
Anyone want to help me with the scoring mechanism? I don't know exactly where I should put the command to add points to the score.
I think I've fixed the scoring issue (because I switched to the newer version with animations). To reduce the "confusion" when performing multiple moves rapidly, I increased the "8"s on tile:animate() to 40 and it seems to have made gameplay more fluid.
I will continue to play around with the program and attempt to add features. ;D
EDIT: I've created boxes for the score and highscore, as well as a button to restart. After a win/loss, a try again button will appear if you want to restart (even though the "new game" button is still there <_< ). It won't work with apilevel < 2.0 though.
(http://img.ourl.ca/2048screen.jpg)
Title: Re: 2048 for Nspire
Post by: Nspirecas on April 01, 2014, 12:35:00 am
Thank you pbfy0  :)
Title: Re: 2048 for Nspire
Post by: AnToX98 on April 01, 2014, 11:08:36 am
Nice game and super coding :)
Title: Re: 2048 for Nspire
Post by: jh0421 on April 01, 2014, 07:27:53 pm
This is very nice!


While playing I did notice one thing though: the game seems to allow consecutive combinations when it shouldn't. To clarify, if one row is 4,2,2,_ and you press 'right', you end up with _,_,_,8 (it looks like it combines the 2s, then the resulting 4 with the other 4) instead of _,_,4,4 as it should be.


Anyways, great job, I've enjoyed this a lot!
Title: Re: 2048 for Nspire
Post by: DJ Omnimaga on April 02, 2014, 11:52:37 am
Looks very fun :D