Tuesday, 02 December 2008
Home
Forum
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome,
Guest
. Please
login
or
register
.
December 02, 2008, 08:59:11 AM
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
got a problem with my code
DSLua Community
Welcome,
Guest
. Please
login
or
register
.
December 02, 2008, 08:59:11 AM
1723
Posts in
315
Topics by
6335
Members
Latest Member:
prertymes
Home
Help
Search
Login
Register
DSLua Community
|
DSLua - Best scripting language for Nintendo DS
|
Need Help?
|
got a problem with my code
« previous
next »
Pages:
[
1
]
Print
Author
Topic: got a problem with my code (Read 688 times)
sllide
New Moon
Posts: 5
got a problem with my code
«
on:
June 08, 2008, 02:44:54 PM »
i dowloaded dslua 0.7 this morning
and i'm bussy all day to get this code to work
SCREEN_BOTTOM = 1
BGBot8Bit = Screen.Load8BitBG()
BGBotText = Screen.LoadTextBG()
Screen.Initialize(SCREEN_BOTTOM,BGBotText,BGBot8Bit)
x = 0
y = 0
BGTopText:PrintXY(0,0,"generating")
while x ~= 31 and y ~= 23
BGBot8Bit:Plot(x,y,random(0,1,2,3,4,5,6,7,8,9))
if x == 31
y + 1
x = 0
else
x + 1
end
end
BGbottext:clear()
DSLua.WaitForAnyKey()
what did i do wrong?
Logged
Jeremysr
Waxing Gibbous
Posts: 254
Re: got a problem with my code
«
Reply #1 on:
June 08, 2008, 05:52:35 PM »
The second-last line is the problem. BGbottext:clear() should be BGBotText:Clear().
Also, the "y + 1" and "x + 1" lines won't do anything, I think you want to put "y = y + 1" and "x = x + 1".
Logged
sllide
New Moon
Posts: 5
Re: got a problem with my code
«
Reply #2 on:
June 09, 2008, 03:05:17 PM »
ok did what u say but still isnt working
and i changed the code a bit i thought this maiby worked -.-
BGBot8Bit = Screen.Load8BitBG()
Screen.Initialize( SCREEN_BOTTOM, BGBot8Bit)
BGBot8Bit:SetPaletteColor( CA, 31, 0, 0 )
BGBot8Bit:SetPaletteColor( CB, 0, 31, 0 )
BGBot8Bit:SetPaletteColor( CC, 0, 0, 31 )
BGBot8Bit:SetPaletteColor( CD, 31, 15, 0 )
BGBot8Bit:SetPaletteColor( CE, 31, 31, 0 )
BGBot8Bit:SetPaletteColor( CF, 15, 15, 15 )
BGBot8Bit:SetPaletteColor( CG, 31, 31, 31 )
X = 0
Y = 0
while X ~= 31 and Y ~= 23
BGBot8Bit:Plot( X, Y, Random(CA,CB,CC,CD,CE,CF,CG))
if X == 31
Y = Y + 1
X = 0
else
X = X + 1
end
end
DSLua.WaitForAnyKey()
«
Last Edit: June 09, 2008, 04:46:19 PM by sllide
»
Logged
Jeremysr
Waxing Gibbous
Posts: 254
Re: got a problem with my code
«
Reply #3 on:
June 09, 2008, 05:31:36 PM »
All you need, I think, for that code to work is to give all your colours values like this:
CA = 0
CB = 1
CC = 2
CD = 3
CE = 4
CF = 5
CG = 6
Logged
sllide
New Moon
Posts: 5
Re: got a problem with my code
«
Reply #4 on:
June 10, 2008, 09:46:30 AM »
DAMN still doesnt work
BGBot8Bit = Screen.Load8BitBG()
Screen.Initialize( SCREEN_BOTTOM, BGBot8Bit)
BGBot8Bit:SetPaletteColor( 0, 31, 0, 0 )
BGBot8Bit:SetPaletteColor( 1, 0, 31, 0 )
BGBot8Bit:SetPaletteColor( 2, 0, 0, 31 )
BGBot8Bit:SetPaletteColor( 3, 31, 15, 0 )
BGBot8Bit:SetPaletteColor( 4, 31, 31, 0 )
BGBot8Bit:SetPaletteColor( 5, 15, 15, 15 )
BGBot8Bit:SetPaletteColor( 6, 31, 31, 31 )
X = 0
Y = 0
while X ~= 31 and Y ~= 23
BGBot8Bit:Plot( X, Y, Random( 0, 1, 2, 3, 4, 5, 6))
if X == 31
Y = Y + 1
X = 0
else
X = X + 1
end
end
DSLua.WaitForAnyKey()
u try it
maiby what kind of flash-card u have matters
and is there something similar to dslua but with a in-game editor?
«
Last Edit: June 10, 2008, 12:51:06 PM by sllide
»
Logged
Pages:
[
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
DSLua - Best scripting language for Nintendo DS
-----------------------------
=> News and Announcements
=> Examples/Tutorials
=> Home-brew/Hacks/Games/Projects
=> Hardware and Equipments
=> Need Help?
=> Bugs & Suggestions
-----------------------------
General DS Programming Chats
-----------------------------
=> Code Hashing
=> Chat Room
=> Test Area
Powered by SMF 1.1 RC2
|
SMF © 2001-2005, Lewis Media
(C) 2008 DSLua
DSLua - Best scripting language for Nintendo DS home-brew!