Thursday, 20 November 2008
 
  Home arrow Forum  
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome, Guest. Please login or register.
November 20, 2008, 12:16:11 PM
Username: Password:
Login with username, password and session length

Forgot your password?
Jeremysr's "Hangman 1.0"
DSLua Community
Welcome, Guest. Please login or register.
November 20, 2008, 12:16:11 PM
1723 Posts in 315 Topics by 5676 Members
Latest Member: pruccelry
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Examples/Tutorials  |  Jeremysr's "Hangman 1.0" « previous next »
Pages: [1]
Author Topic: Jeremysr's "Hangman 1.0"  (Read 1390 times)
ryo@japan
New Moon
*
Posts: 3



« on: January 01, 2008, 11:19:10 PM »

Hello!  I'm posting from Japan.
Happy new years to every one!

I've been running some DSLua scripts including those made by Jeremysr, for a coupple of days.
(I'm a newbe for DSLua and NDS homebrew programming.)
My environment is:

  NDS Lite -- Ice Blue (just in case Wink)
  M3DSREAL -- a Slot-1 device with 2GB microSD (SANDISK)
  Rumble RAM Pack -- which comes with M3DSREAL
  running DSLua 0.7 Grin

At the first try, I could load the script, but couldn't go on from "Press START to --" message. Cry
If I press START, nothing appears on the BOTTOM SCREEN.

So, I edited Jeremysr's scripts, a little.
I inserted

Code:
Screen.Initialize( SCREEN_BOTTOM, BGBotText )

at the begging of "Start Game" paragraph.

It worked OK.
Now, BOTTOM SCREEN displayed 26 characters and "Please select a letter." caption.

I played a little, then hit A-Button to quit.
But, the script went on, showing another quiz. Huh
After playing that, I could quit the game with hitting A-Button again.

Somehow, loop didn't work properly in the game script.

So, I went back to the script, and at close to the very end, inserted a line:

Code:
DSLua.WaitForAnyKey() 

right before "if Pads.A() then" statement.

This patch solved the timing problem with the while loop.   So it seemed to me.

I played along a little more.  Quit the game and replayed it, then I encountered another problem.
The TOP SCREEN doesn't show texts. Undecided

I went back to the script again.  Inserted

Code:
Screen.Initialize( SCREEN_TOP, BGTopText, BGTop8Bit )

statement right after the "while not quit do" loop (main game loop).
This fixed the TOP SCREEN problem.

I'm not sure if above are DSLua problems or hardware specific problems.
Anyway, "Hangman 1.0" works fine on my NDS now.  Smiley

---
btw, I thougt it a good measure to insert DSLua.WaitForAnyKey() statement into a while loop, when you are waiting for a Key press.  I guess this will save CPU usage and memory access at the same time. Seems better to ensure you catch the button-down event.

Many thanks to Jeremysr, sharing great scripts.\(^o^)/

ryo@japan
« Last Edit: January 03, 2008, 12:59:09 AM by ryo@japan » Logged

sayonara!

ryo
Pages: [1]
« previous next »
    Jump to:  



    (C) 2008 DSLua

    DSLua - Best scripting language for Nintendo DS home-brew!