Author Topic: nMah - Mahjong clone for TI-Nspire  (Read 23921 times)

0 Members and 1 Guest are viewing this topic.

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
nMah - Mahjong clone for TI-Nspire
« on: October 02, 2012, 09:19:18 am »
Hi, this time i'm presenting a new SDL port of a clone of the world famous classic board game: 'Mahjong solitaire' http://en.wikipedia.org/wiki/Mahjong_solitaire.
     
The original game is this one initially developed for linux: http://www.linuxmotors.com/sdllopan/ and called 'sdllopan' by Dave Ashley in 1999. See more on his Linux Zone: http://www.linuxmotors.com/.

Btw: i've also ported some time ago the sdl 'fire demo' from the same author, which you can find here: http://www.omnimaga.org/index.php?PHPSESSID=f0e6ee0b3f490297f0f5aba8f9f52a6e&topic=14288.msg262928#msg262928

and the port to ndless was just a breeze...

Well this time around, things (the port) were quite a bit more complicated, namely because:
   1. due to the small lcd screen we'll have some eye pain to clear distinguish the tiles. Here i could use some help from some artists (Hayleia maybe?) willing to contribute with better looking tiles drawings.
   2. this app originally uses the mouse and in ndless/emulator we don't have it  :(. So we need to emulate it with keys (using 'SDL_WarpMouse' etc).
   3. It creates its own font for text, but that didn't work properly in ndless either. So i had to change it to use hoffa's 'nSDL_LoadFont' + 'nSDL_DrawString'.
   4. as the sdl video memory is being directly pixel-manipulated the code is written to support the 16-bit bit-depth and i do not intend to support also the non-cx models. sorry about that.

Ok, let's go straight to the 'how to use the thing':
I - First, in the calc create a folder inside 'ndless' and name it 'nMah' (or whatever). Inside 'nMah' create another folder 'Data' (this name is fixed!)


Upload to the calc:
   a. the program 'nMah.tns' to the 'ndless/nMah' folder.
   b. the program's data files (tiles + several backgorunds) to 'ndless/nMah/Data' folder.

II- Keys/Instructions:
---------- cut here ------------>
"Mouse- emulation"
Movement: key_left, key_right, key_up, key_down or key_4, key_6, key_8, key_2
Click:        key_5 (ONLY!) dunno how to handle nspire-click key via SDL (maybe hoffa could help here? :-\)

key_return: shuffles the titles and restarts a new game.

key_7: changes tile-set    (we only have 2 at the moment)
key_9: changes background   (we have 10 available)
key_1: Undo
key_3: Redo

key_esc: Quit
<---------- cut here ------------

Have more fun,
SpiroH


Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #1 on: October 02, 2012, 01:39:00 pm »
Oooh nice! I love mahjong :D Downloading this right now. Good job! And looking at the screenshots, it seems the problem of distinguishing tiles isn't a very big problem :)

Some people need a high five in the face... with a chair.
~EC

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #2 on: October 02, 2012, 03:10:04 pm »
Great project!  Looks like fun! ;)


Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #3 on: October 02, 2012, 03:11:37 pm »
Looks nice, congrats !
I will give it a try, even if I'm not too fond of Mahjong solitaire...

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: nMah - Mahjong clone for nSpire
« Reply #4 on: October 02, 2012, 03:14:35 pm »
Wow that makes my day. I do not play this that often but my mom introduced me to the game and it was very fun. Also is the fire demo the same as the one on TI-Planet? I couldn't run the TI-Planet one (nor the parralax scrolling demo) D:

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #5 on: October 02, 2012, 05:33:02 pm »
Aw man... I was really excited that it was Mohjang and not Mohjang solitaire...
Misleading title D:

edit: fail typos. Mahjong, not Mohjang
« Last Edit: October 02, 2012, 10:11:31 pm by AzNg0d1030 »
You just lost the game.



Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: nMah - Mahjong clone for nSpire
« Reply #6 on: October 02, 2012, 05:34:45 pm »
Aw man... I was really excited that it was Mohjang and not Mohjang solitaire...
Misleading title D:
I didn't know there was another game named Mohjang than the one he ported ^^
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: nMah - Mahjong clone for nSpire
« Reply #7 on: October 02, 2012, 08:10:20 pm »
It is looking awesome so far, keep up the good work :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #8 on: October 02, 2012, 08:43:07 pm »
Ooh. Mahjong. How do I play it? XP
Sig wipe!

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #9 on: October 02, 2012, 10:10:37 pm »
Aw man... I was really excited that it was Mohjang and not Mohjang solitaire...
Misleading title D:
I didn't know there was another game named Mohjang than the one he ported ^^
http://en.wikipedia.org/wiki/Mahjong
The original Chinese tile/card game
Mahjong solitaire came from that. (They are completely unrelated though, but they use the same tiles)
If you read the wiki for Mahjong Solitaire, it says that it was based off of Mahjong and the solitaire version was a computer game developed in the 1980s. Not the actual 'Mahjong.'

(Oh i typo'd the previous post lol not Mohjang, Mahjong FAIL)
« Last Edit: October 02, 2012, 10:13:25 pm by AzNg0d1030 »
You just lost the game.



Offline Wayne

  • LV3 Member (Next: 100)
  • ***
  • Posts: 72
  • Rating: +3/-3
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #10 on: October 03, 2012, 05:57:09 am »
One of my fave games, nice work.

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #11 on: October 03, 2012, 06:47:53 am »
...Also is the fire demo the same as the one on TI-Planet? I couldn't run the TI-Planet one (nor the parralax scrolling demo) D:
I don't know which one you're referring too? Any direct link, so that i can check it out? But, in principle, i don't think so, or the french 'guys' would already have warned me, i gather.

Thank you all for the generous comments. Hope to see soon so more nSDL ports to nSpire. Hoffa's SDL port is really quite a great achievement for the nSpire/ndless community. Cheers.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: nMah - Mahjong clone for nSpire
« Reply #12 on: October 03, 2012, 07:08:46 am »
He's referring to Critor's port of "XFlame", which you can find here : http://tiplanet.org/forum/archives_voir.php?id=6045
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: nMah - Mahjong clone for nSpire
« Reply #13 on: October 03, 2012, 01:56:46 pm »
He's referring to Critor's port of "XFlame", which you can find here : http://tiplanet.org/forum/archives_voir.php?id=6045
Thanks for the link! xflame from TI-Planet works fine in CX models but not on non-CX (it reboots with ndless 3.1)! Out of curiosity, i've picked up the source and recomplied it for ndless 3.1. Again, it works only in CX models and gives a black screen in non-CXs (i've added a temporary 'srand/rand' fix to prevent reboot). This is also due to direct video memory manipulation (which isn't portable). You may have a look at the source. btw, i've rebranded it from xflame to nflame to distinguish the exe's. On more to add to the nSDL collection. Good for beginners. :)


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: nMah - Mahjong clone for nSpire
« Reply #14 on: October 14, 2012, 08:02:52 pm »
Yep it was Xflame and the parralax scrolling demos. In my case, I was never able to run both on my TI-Nspire CX. I got OS 3.1 and I tried 3 different Ndless versions (including the latest), to no avail. The calculator simply rebooted. I'll try this new version when I have some time.
« Last Edit: October 14, 2012, 08:03:22 pm by DJ_O »