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, 11:08:15 AM
Username: Password:
Login with username, password and session length

Forgot your password?
Demo for Ur Game
DSLua Community
Welcome, Guest. Please login or register.
November 20, 2008, 11:08:15 AM
1723 Posts in 315 Topics by 5674 Members
Latest Member: MTIncongoatabor
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Examples/Tutorials  |  Demo for Ur Game « previous next »
Pages: [1]
Author Topic: Demo for Ur Game  (Read 1898 times)
manu62300
Waxing Crescent
**
Posts: 97



« on: July 17, 2007, 05:20:50 AM »

 

the personnage sprite for change emotion,the text is progressve ,ideal for RPG or intro of Ur game  Cheesy

Code:
SCREEN_BOT = 0
PAL_ISAAC = 0
PAL_NINA = 1

function waitForStylus()
x = 0
while x == 0 do
if Stylus.Down() then
x = 1
end
end
end

function DSLua.ProgressiveString(progstr,coloredwut,screenwhich,delaybetweeneach,xvl,yvl)
for current_position = 1, string.len( progstr ) do
current_char = string.sub( progstr, current_position, current_position )
if screenwhich == 0 then
BGBotText:SetColor(coloredwut)
BGBotText:PrintXY( xvl, yvl, current_char )
end
if screenwhich == 1 then
BGTopText:SetColor(coloredwut)
BGTopText:PrintXY( xvl, yvl, current_char )
end
if screenwhich == 2 then
BGBotText:SetColor(coloredwut)
BGTopText:SetColor(coloredwut)
BGBotText:PrintXY( xvl, yvl, current_char )
BGTopText:PrintXY( xvl, yvl, current_char )
end
for delay = 1, delaybetweeneach do end
xvl = xvl + 1
if xvl == 32 then xvl = 0 yvl = yvl + 1
end
end
end

BGBotMap = Screen.LoadTileBG()
BGBotMap:LoadPalette( "actionbg.pal" )
BGBotMap:LoadTiles( "actionbg.raw", 256 )
BGBotMap:LoadMap( "actionbg.map", ( 256/8 ), ( 192/8 ))
BGBotText = Screen.LoadTextBG()
Screen.Initialize( 0, BGBotText, BGBotMap )
Screen.WaitForVBL()

Sprite.LoadPalette( 0, 0, "Isaac.pal" )
Sprite.LoadPalette( 0, 1, "Nina.pal" )

IsaacFrames  = FrameStrip.Create( 0, 64, 64, "256" )
NinaFrames  = FrameStrip.Create( 0, 64, 64, "256" )

IsaacFrames:LoadBin( "Isaac.raw", 1 )
NinaFrames:LoadBin( "Nina.raw", 1 )

while true do

if Stylus.Down() then
Isaac  = Sprite.Create( IsaacFrames, 0, 0, 190, 126 )
Nina  = Sprite.Create( NinaFrames, 0, 1, 2, 2 )
    DSLua.ProgressiveString("Nina:",1,0,5000,9,1)
    DSLua.ProgressiveString("Bonjour Isaac^^",0,0,5000,15,1)
    DSLua.ProgressiveString("Comment vas tu ?",0,0,5000,9,2)
    DSLua.ProgressiveString("Isaac:",3,0,5000,0,16)
    DSLua.ProgressiveString("Nina, pourquoi es",0,0,5000,6,16)
    DSLua.ProgressiveString("tu venu me voir ?",0,0,5000,0,17)
    DSLua.ProgressiveString("Je t'avais dis non..",0,0,5000,0,18)
    DSLua.ProgressiveString("Jamais je ne pourrais...",0,0,5000,9,3)
  DSLua.ProgressiveString("Pourtant il le faudra.",0,0,5000,0,19)
DSLua.ProgressiveString("Jamais tu entends..8-(",0,0,5000,9,4)
end
end

Logged

XtreamLua.com
La Référence en programmation sur PSP & DS
xtreamlua.miniville.fr
Bon dev...;
daltonlaffs
Waxing Gibbous
****
Posts: 340


Freaking Insane


WWW
« Reply #1 on: July 17, 2007, 09:49:58 AM »

It looks nice  Wink

One thing, though, give credit for the functions you used. waitForStylus() was Jeremysr's, and ProgressiveString() was mine.
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
manu62300
Waxing Crescent
**
Posts: 97



« Reply #2 on: July 17, 2007, 09:56:57 AM »

It looks nice  Wink

One thing, though, give credit for the functions you used. waitForStylus() was Jeremysr's, and ProgressiveString() was mine.
Yeah Authors: Jeremysr & Daltonlaffs  in "functions.inc.lua"
Logged

XtreamLua.com
La Référence en programmation sur PSP & DS
xtreamlua.miniville.fr
Bon dev...;
Jeremysr
Waxing Gibbous
****
Posts: 254



WWW
« Reply #3 on: July 20, 2007, 01:33:46 PM »

You should just use while not Stylus.Down() do end instead of waitForStylus() Tongue
Logged
molster
Waxing Crescent
**
Posts: 19


« Reply #4 on: July 21, 2007, 03:00:15 PM »

You guys might want to fix that function on your "functions 2.6" version, you have the function named as

Code:
function DSLua.ProgressiveString(progstr,coloredwut,screenwhich,delaybetweeneach,xvl,yvl)

but up top were you tell what it means, you have it named

Code:
DSLua.ProgressiveText()

You might want to fix that.. cuase i got an error.. took me a min to figure out what was wrong. (Text vs String at the end if you cant tell)
Logged
manu62300
Waxing Crescent
**
Posts: 97



« Reply #5 on: July 22, 2007, 03:58:33 AM »

DSLua.ProgressiveString == DSLua.ProgressiveText  Wink
Logged

XtreamLua.com
La Référence en programmation sur PSP & DS
xtreamlua.miniville.fr
Bon dev...;
molster
Waxing Crescent
**
Posts: 19


« Reply #6 on: July 22, 2007, 04:00:41 PM »

huh? do you even know what im talking about?  They have the following functions all set up in one script, and they have an erorr, where they say what it does, and the have it has "text" at the end, and in the functions itself, its called "string" so when someone calles it, it will give an error saying no such thing.
Logged
manu62300
Waxing Crescent
**
Posts: 97



« Reply #7 on: August 03, 2007, 01:17:44 PM »

I havn't write DSLua.ProgressiveText ,i write DSLua.Progressivestring but i have input the text Wink
Logged

XtreamLua.com
La Référence en programmation sur PSP & DS
xtreamlua.miniville.fr
Bon dev...;
Pages: [1]
« previous next »
    Jump to:  



    (C) 2008 DSLua

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