Author Topic: 2048 for Nspire  (Read 20686 times)

0 Members and 1 Guest are viewing this topic.

Offline pbfy0

  • LV2 Member (Next: 40)
  • **
  • Posts: 31
  • Rating: +7/-0
    • View Profile
2048 for Nspire
« 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 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.

New: Now has graphics based on NBonaparte's modification
« Last Edit: April 05, 2014, 02:24:32 pm by pbfy0 »

Offline nspireguy

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +11/-6
    • View Profile
    • NspireGuy
Re: 2048 for Nspire
« Reply #1 on: March 29, 2014, 06:47:34 pm »
This looks really good!
Good job.

Offline LDStudios

  • Coder Of Tomorrow
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 388
  • Rating: +41/-1
    • View Profile
    • LD Studios
Re: 2048 for Nspire
« Reply #2 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.
« Last Edit: March 29, 2014, 07:25:38 pm by LDStudios »



Offline jiagejiage

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #3 on: March 30, 2014, 05:42:28 am »
it didn't support os3.1...sad news

Offline kevinkore3

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #4 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.

Offline LDStudios

  • Coder Of Tomorrow
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 388
  • Rating: +41/-1
    • View Profile
    • LD Studios
Re: 2048 for Nspire
« Reply #5 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.



Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: 2048 for Nspire
« Reply #6 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. ._.

Offline kevinkore3

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #7 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.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: 2048 for Nspire
« Reply #8 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.

Offline Nspirecas

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #9 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
« Last Edit: March 31, 2014, 05:10:07 pm by Nspirecas »

Offline NBonaparte

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #10 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.

Offline kevinkore3

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #11 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

Offline NBonaparte

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #12 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.
« Last Edit: March 31, 2014, 11:23:48 pm by NBonaparte »

Offline Nspirecas

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: 2048 for Nspire
« Reply #13 on: April 01, 2014, 12:35:00 am »
Thank you pbfy0  :)
« Last Edit: April 01, 2014, 12:37:13 am by Nspirecas »

Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: 2048 for Nspire
« Reply #14 on: April 01, 2014, 11:08:36 am »
Nice game and super coding :)



My Lua projects :