Omnimaga

Omnimaga => Completed => Our Projects => Trapped for the TI-Nspire and TI-89 => Topic started by: apcalc on April 14, 2011, 10:33:23 pm

Title: Block Dude in Lua
Post by: apcalc on April 14, 2011, 10:33:23 pm
In order to become acquainted with the Lua language for the Nspire, I have decided to port Block Dude to Lua!  This is in extremely early stages, and, at this point, my knowledge of Lua is still quite low.  Nevertheless, some basic features are currently working:

(http://i974.photobucket.com/albums/ae226/apcalc/NSPIREVIDEO0014.gif)

Hopefully, this will progress quickly! :)
Title: Re: Block Dude in Lua
Post by: ralphdspam on April 14, 2011, 10:36:37 pm
Nice work!  It is great that this calculator game classic is being ported to the Nspire. :)

I wish you good programming!
Title: Re: Block Dude in Lua
Post by: Lionel Debroux on April 15, 2011, 02:03:03 am
Good :)
Title: Re: Block Dude in Lua
Post by: shmibs on April 15, 2011, 02:32:06 am
i'm glad to see that some good is already coming of 3.0. lua looks very promising, even if it is more limited than asm.
Title: Re: Block Dude in Lua
Post by: Stefan Bauwens on April 15, 2011, 03:51:21 am
Nice work!  It is great that this calculator game classic is being ported to the Nspire. :)

I wish you good programming!
There already exist blockdude for the nspire, made by Apcalc. Ofcourse it might not work amore with all those updates.

Apcalc, that's really nice.
Title: Re: Block Dude in Lua
Post by: Munchor on April 15, 2011, 07:24:28 am
In order to become acquainted with the Lua language for the Nspire, I have decided to port Block Dude to Lua!  This is in extremely early stages, and, at this point, my knowledge of Lua is still quite low.  Nevertheless, some basic features are currently working:

(http://i974.photobucket.com/albums/ae226/apcalc/NSPIREVIDEO0014.gif)

Hopefully, this will progress quickly! :)

That is looking good! Nice job :) Awaiting further development :D
Title: Re: Block Dude in Lua
Post by: Adriweb on April 15, 2011, 09:20:08 am
Really nice :)

Maybe we'll find some more api functions to program games more easily tho :P
Title: Re: Block Dude in Lua
Post by: ruler501 on April 15, 2011, 01:05:36 pm
I'll start writing a port of one of my TI-BASIC games I made later.
This sounds like it will be fun

I can't wait for a release of this
Title: Re: Block Dude in Lua
Post by: renatose on April 15, 2011, 02:38:44 pm
hey scout apcalc, do you want my help porting block dude?

EDIT:thank you for the correction stefan  ;)
Title: Re: Block Dude in Lua
Post by: Stefan Bauwens on April 15, 2011, 02:40:24 pm
hey scout, do you want my help porting block dude?
I think you mean Apcalc. ;)
Title: Re: Block Dude in Lua
Post by: apcalc on April 15, 2011, 09:33:56 pm
hey scout apcalc, do you want my help porting block dude?

EDIT:thank you for the correction stefan  ;)

I thank you for your offer, but since this is being heavily based on my previous Block Dude in C, all I really need to do is change the syntax around.  In fact, I am really just about done with this! :)
Title: Re: Block Dude in Lua
Post by: ruler501 on April 15, 2011, 09:48:45 pm
When can we expect a release date?
Title: Re: Block Dude in Lua
Post by: Goplat on April 16, 2011, 01:12:02 am
this is being heavily based on my previous Block Dude in C
So, this is a TI-Nspire Lua port of a TI-Nspire C game which was a port of a TI-83+ game which was a port of a DOS game? :p
Title: Re: Block Dude in Lua
Post by: DJ Omnimaga on April 16, 2011, 02:03:41 am
Lol Goplat. :P

I didn't know the 83+ game was a port of a DOS game, though. I was sure it was the original. O.O

ANyway I think this is mostly to show what the Lua language can do so far. Looks nice Apcalc. Do you think you can add actual textures or is that beyond Lua capabilities on the Nspire?
Title: Re: Block Dude in Lua
Post by: Goplat on April 16, 2011, 04:30:16 am
I didn't know the 83+ game was a port of a DOS game, though. I was sure it was the original. O.O

It was based on "Block-man 1" by Soleau Software (http://www.soleau.com/dosgame.html). Levels 1-10 of Block Dude are pretty much identical to levels A-J of Block-man (levels 11+ are new).
Title: Re: Block Dude in Lua
Post by: Munchor on April 16, 2011, 04:43:07 am
I didn't know the 83+ game was a port of a DOS game, though. I was sure it was the original. O.O

It was based on "Block-man 1" by Soleau Software (http://www.soleau.com/dosgame.html). Levels 1-10 of Block Dude are pretty much identical to levels A-J of Block-man (levels 11+ are new).

I didn't know it wasn't an original too, so we can say apcalc's games aren't ports of Block Dude but of Block-Man 1 :P
Title: Re: Block Dude in Lua
Post by: apcalc on April 16, 2011, 07:31:22 pm
I didn't know the 83+ game was a port of a DOS game, though. I was sure it was the original. O.O

It was based on "Block-man 1" by Soleau Software (http://www.soleau.com/dosgame.html). Levels 1-10 of Block Dude are pretty much identical to levels A-J of Block-man (levels 11+ are new).

Very interesting, Goplat!

I was just thinking, in order to keep things original/different, maybe I will include all of the "Block Man" levels in the Lua version, and keep the "Block Dude" levels in the C version! :)
Title: Re: Block Dude in Lua
Post by: willrandship on April 16, 2011, 08:23:01 pm
Support for custom levels, maybe?
Title: Re: Block Dude in Lua
Post by: ruler501 on April 16, 2011, 10:00:08 pm
Support for custom levels, maybe?

That would be good but then we'd need file parsing support in LUA. has anyone figured out how to do that on the Nspire yet?
Title: Re: Block Dude in Lua
Post by: XVicarious on April 16, 2011, 10:01:48 pm
Hum... I wonder if its possible to save the level data to like 1.2 - 1.whatever
Title: Re: Block Dude in Lua
Post by: apcalc on April 16, 2011, 10:14:09 pm
Hum... I wonder if its possible to save the level data to like 1.2 - 1.whatever

That would be possible, but I think I would then have to include the game code on each page also...

Space wise, it would probably be better to keep them on 1 page
Title: Re: Block Dude in Lua
Post by: Goplat on April 16, 2011, 10:20:37 pm
Hum... I wonder if its possible to save the level data to like 1.2 - 1.whatever
You can store to variables of the current problem with var.store(name, value) (note: it seems this only works if the variable already exists) and recall them with var.recall(name) (returns nil if the variable doesn't exist).
Title: Re: Block Dude in Lua
Post by: ruler501 on April 16, 2011, 10:23:12 pm
We could possibly save maps as strings...

Does Lua have a good string parser?
Title: Re: Block Dude in Lua
Post by: Levak on April 16, 2011, 11:54:40 pm
Hum... I wonder if its possible to save the level data to like 1.2 - 1.whatever
You can store to variables of the current problem with var.store(name, value) (note: it seems this only works if the variable already exists) and recall them with var.recall(name) (returns nil if the variable doesn't exist).
Well, for me var.store() perfectly works, even if the variable wasn't there before.
Title: Re: Block Dude in Lua
Post by: Deep Toaster on April 17, 2011, 12:16:41 am
Wow nice! Now we need to get the TI Lua community rolling :)
Title: Re: Block Dude in Lua
Post by: Munchor on April 17, 2011, 05:44:10 am
@apcalc: Will this be open source? I'd really like it so I can learn how to use LUA in the NSpire.
Title: Re: Block Dude in Lua
Post by: Lionel Debroux on April 17, 2011, 05:47:03 am
Due to the way third-party Lua TNS files are currently generated, they are open source :)
Just decompress the TNS with pretty much any ZIP-capable program or library.
Title: Re: Block Dude in Lua
Post by: Munchor on April 17, 2011, 05:48:00 am
Due to the way third-party Lua TNS files are currently generated, they are open source :)
Just decompress the TNS with pretty much any ZIP-capable program or library.

That's not being open source, but nice to know we can have the source.
Title: Re: Block Dude in Lua
Post by: apcalc on April 17, 2011, 09:04:25 am
Yep, this will be open source! :)
Title: Re: Block Dude in Lua
Post by: renatose on April 17, 2011, 09:53:13 am
that's good to know :)
Title: Re: Block Dude in Lua
Post by: apcalc on April 17, 2011, 10:53:25 am
COLORS!!!!  (Thanks to Adriweb for the "dude" sprite! :))

(http://img.removedfromgame.com/imgs/bd_colors.png)

EDIT:  Also, here is a beta release in case anyone wants to play with it/look at the source (the color pics don't look all that great in B&W; this will eventually be fixed)

Press Enter to reset the level (or play again after you won)
Title: Re: Block Dude in Lua
Post by: Adriweb on April 17, 2011, 01:35:48 pm
haha you're welcome :P

Great code, great game :)

Congratulations !
Title: Re: Block Dude in Lua
Post by: apcalc on April 17, 2011, 01:37:04 pm
New screenshots!  All that is left to do is add transitioning of levels! :D

(http://img.removedfromgame.com/imgs/NSPIREVIDEO0016.gif)
(http://img.removedfromgame.com/imgs/bd_colors_2.png)
Title: Re: Block Dude in Lua
Post by: GB on April 17, 2011, 02:54:58 pm
Nice work!
Title: Re: Block Dude in Lua
Post by: ruler501 on April 17, 2011, 04:14:06 pm
Wow this is great. Do you have Level Keys set up yet?
Title: Re: Block Dude in Lua
Post by: apcalc on April 17, 2011, 04:17:07 pm
Wow this is great. Do you have Level Keys set up yet?

I don't think there will be any need for level keycodes in this.  Closing/Reopening the document does not change the position in the game, thus it will be "saved" at your respective spot.  You will be able to press "Enter" to restart a level, or "A" to go back to level 1. :)
Title: Re: Block Dude in Lua
Post by: Hot_Dog on April 17, 2011, 04:19:02 pm
Holy, I loved the colored version.  Who would have thought it could be so easy
Title: Re: Block Dude in Lua
Post by: ruler501 on April 17, 2011, 04:19:51 pm
Is there any way to go back to specific levels?
and I thought they do restart. 15 puzzle does
Title: Re: Block Dude in Lua
Post by: apcalc on April 17, 2011, 04:22:11 pm
Is there any way to go back to specific levels?
and I thought they do restart. 15 puzzle does

15 puzzle restarts every time because it calls the reset function each time you open the document.  Block Dude does the same, except it calls it for the current value of the variable "currlevel" which will not change.
Title: Re: Block Dude in Lua
Post by: ExtendeD on April 17, 2011, 05:32:46 pm
Nice apcalc :)
Title: Re: Block Dude in Lua
Post by: renatose on April 17, 2011, 06:28:41 pm
go dude :p
we're awaiting the release of crisis in Lua for the nspire xD
Title: Block Dude Lua
Post by: apcalc on April 18, 2011, 06:55:08 am
Block Dude Lua



http://www.omnimaga.org/index.php?action=downloads;sa=view;down=655
Title: Re: Block Dude in Lua
Post by: apcalc on April 18, 2011, 07:07:34 am
Uploaded to ticalc, Omni archives, and TI-Bank! :)
Title: Re: Block Dude in Lua
Post by: Munchor on April 18, 2011, 07:40:16 am
Uploaded to ticalc, Omni archives, and TI-Bank! :)

Nice job apcalc! This was coded very fast :D
Title: Re: Block Dude in Lua
Post by: aeTIos on April 18, 2011, 07:43:12 am
ACtually, yep. I cant get this thing running on the computer, though :(
Title: Re: Block Dude in Lua
Post by: Deep Toaster on April 18, 2011, 09:22:24 am
Looking great! How did you screenshot the colors?
Title: Re: Block Dude in Lua
Post by: aeTIos on April 18, 2011, 09:24:06 am
with this: http://education.ti.com/html/nspireplayer/3.0.1/application/index.html (I think) Warning don't go to there, it takes forever to load x.x
Title: Re: Block Dude in Lua
Post by: Munchor on April 18, 2011, 09:32:34 am
with this: http://education.ti.com/html/nspireplayer/3.0.1/application/index.html (I think) Warning don't go to there, it takes forever to load x.x

I still will load it, I'm curious.
Title: Re: Block Dude in Lua
Post by: BrownyTCat on April 18, 2011, 01:54:08 pm
I have intermediate Lua knowledge. I might be able to help. I think. :|
Title: Re: Block Dude in Lua
Post by: Stefan Bauwens on April 18, 2011, 01:59:27 pm
Uploaded to ticalc, Omni archives, and TI-Bank! :)
So it's finished? Wow, nice!
Title: Re: Block Dude in Lua
Post by: renatose on April 18, 2011, 02:00:09 pm
is it just me or there is just the first level?
this is like a demo game released before the release of the game itself to leave the gamers expecting the great game comming :p
Title: Re: Block Dude in Lua
Post by: apcalc on April 18, 2011, 05:34:57 pm
is it just me or there is just the first level?
this is like a demo game released before the release of the game itself to leave the gamers expecting the great game comming :p

The version on ticalc and in the omni archives (not the download in this thread) are the full versions.  The ones on TI-Bank and the download in this thread seem to be the Level 1 demo I posted yesterday.
Title: Re: Block Dude in Lua
Post by: GB on April 18, 2011, 06:01:18 pm
Does the new LUA version have the same graphics as the original Ndless one? I liked the way the blocks (the moveable ones) looked with the gradient.
Title: Re: Block Dude in Lua
Post by: BrownyTCat on April 18, 2011, 06:04:04 pm
Does the new LUA version have the same graphics as the original Ndless one? I liked the way the blocks (the moveable ones) looked with the gradient.

It was cool, but I thought it could have looked a bit nicer with a background and at least 2-frame animations in the character. Still good though, it's just sometimes odd when there's so many gradients.
Title: Re: Block Dude in Lua
Post by: DJ Omnimaga on April 18, 2011, 08:27:06 pm
I'M glad this is out. :D You should add a title screen, though. :)
Title: Re: Block Dude in Lua
Post by: renatose on April 19, 2011, 05:59:08 pm
is it just me or there is just the first level?
this is like a demo game released before the release of the game itself to leave the gamers expecting the great game comming :p

The version on ticalc and in the omni archives (not the download in this thread) are the full versions.  The ones on TI-Bank and the download in this thread seem to be the Level 1 demo I posted yesterday.

ok, nice then! I'll try it tomorrow...
Title: Re: Block Dude in Lua
Post by: yunhua98 on May 18, 2011, 04:50:34 pm
I just tried this, and it's very nice.  ;)  I'm definitely keeping it on my calc.  ;)
Title: Re: Block Dude in Lua
Post by: Deep Toaster on May 19, 2011, 03:57:54 pm
Bleh, assuming you don't upgrade.
Title: Re: Block Dude in Lua
Post by: yunhua98 on May 19, 2011, 04:21:02 pm
The news said there isn't a 3.0.2 for the CX yet...

btw, I'm happy to say the CX seems to be backwards compatible with he greyscale Nspires.
Title: Re: Block Dude in Lua
Post by: critor on May 19, 2011, 04:35:15 pm
The news said there isn't a 3.0.2 for the CX yet...

Both CAS and non-CAS 3.0.2 OSes are available for the CX since the beginning.
The link to the CAS CX OS on TI web site is bad, but a fixed link is available in the TI-Bank news:
http://ti.bank.free.fr/index.php?mod=news&ac=commentaires&id=1108
Title: Re: Block Dude in Lua
Post by: pimathbrainiac on March 26, 2013, 08:55:41 pm
I saw a kid (A Junior) at school today who said that he programmed this and a friend of his put it online... (He gave me details... such as using Notepad++ and some iPad Lua programming app to program it.)

What I want to know is: Is this kid crazy? Or is there some truth to this?
Title: Re: Block Dude in Lua
Post by: DJ Omnimaga on March 27, 2013, 01:22:50 am
He must have been trying to brag about having made a game for a calculator even though it isn't true.
Title: Re: Block Dude in Lua
Post by: Stefan Bauwens on March 27, 2013, 05:17:06 am
That doesn't make sense since this is released before that Ipad app was out.
Title: Re: Block Dude in Lua
Post by: Adriweb on March 27, 2013, 06:33:38 am
Was it the exact same ? Even though it's "possible" it's unlikely.

However, programming [Nspire] Lua on iPad is possible;
Title: Re: Block Dude in Lua
Post by: pimathbrainiac on March 27, 2013, 09:17:34 am
He wasn't using the iPad nSpire app. He said it was a Lua IDE.

Anyway, I don't believe him, but I just wanted to make sure he's lying.

And yes, it was the exact same. (Maybe the kid lied to me and in fact is apcalc (highly unlikely), or maybe he's just lying)