![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on lua help within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; i made this game using progam lua but i dont no wuts wrong with it. please help. green = Color.new(0,255,0) ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
i made this game using progam lua but i dont no wuts wrong with it. please help.
green = Color.new(0,255,0) math.randomseed(os.time() ) LotteryNumbers = {2,12,16,19,32,48} winningNumber = 1 oldpad = Controls.read() while true do screen:clear() pad = Controls.read() if pad:cross() and oldpad:cross() ~= pad:cross() then winningNumber = math.random(1,65) end if winningNumber == Lotterynumbers[1]then screen rint(100,100"YOU WIN!",green)end if winningNumber == Lotterynumbers[2]then screen rint(100,100"YOU WIN!",green)end if winningNumber == Lotterynumbers[3]then screen rint(100,100"YOU WIN!",green)end if winningNumber == Lotterynumbers[5]then screen rint(100,100"YOU WIN!",green)end if winningNumber == Lotterynumbers[6]then screen rint(100,100"YOU WIN!",green)end screen rint(10,10,winnin gNumber,green)screen.waitVblankstart() screen.flip() oldpad = pad end |
|
|
|
|
|
|
#3 |
|
because when u type in : p next to eachother it makes a smiley.
can anyone fix my code? -= Double Post =- sorry for double post but can someone tell me wut i did wrong Last edited by mditalia13; 08-18-2006 at 06:33 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#4 |
![]() ![]() sceKernelExitGame();
|
First off, wrong section...
Second, try using elseif statements, and setting Winningnumber to nil, like so Code:
Winningnumber = nil
__________________
|
|
|
|
|
|
#7 |
![]() |
u forgot to put the comma in here:
Code:
Before: if winningNumber == Lotterynumbers[1]then screen:print(100,100"YOU WIN!",green) end After: if winningNumber == Lotterynumbers[1]then screen:print(100,100,"YOU WIN!",green)
__________________
...Just Returned To The Scene... |
|
|
|
|
|
#8 |
![]() ![]() Developer
|
You would also need a space before the keyword 'then'
Code:
if winningNumber == Lotterynumbers[1]then Code:
if winningNumber == Lotterynumbers[1] then Code:
screen:print(10,10,winnin gNumber,green) Code:
screen:print(10,10,winningNumber,green) |
|
|
|
|
|
#12 |
![]() ![]() Developer
|
|
|
|
|
|
|
#16 | |
![]() ![]() Your Fate is Grim...
|
Quote:
blit the image either in a function of ur while true do loop.
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
|
#18 |
|
is this right? i dont think it is.
green = Color.new(0,255,0) math.randomseed(os.time() ) LotteryNumbers = {2,12,16,19,32,48} winningNumber = 1 oldpad = Controls.read() fetch[3] = Image.load("image.png") while true do screen:blit(0, 0, (fetch[3])) screen:clear() pad = Controls.read() if pad:cross() and oldpad:cross() ~= pad:cross() then winningNumber = math.random(1,65) end if winningNumber == LotteryNumbers[1] then screen rint(100,100,"YOU WIN!",green)end if winningNumber == LotteryNumbers[2] then screen rint(100,100,"YOU WIN!",green)end if winningNumber == LotteryNumbers[3] then screen rint(100,100,"YOU WIN!",green)end if winningNumber == LotteryNumbers[5] then screen rint(100,100,"YOU WIN!",green)end if winningNumber == LotteryNumbers[6] then screen rint(100,100,"YOU WIN!",green)end screen rint(10,10,winnin gNumber,green)screen.waitVblankStart() screen.flip() oldpad = pad end |
|
|
|
|
|
|
#19 | |
![]() |
Quote:
__________________
...Just Returned To The Scene... |
|
|
|
|
|
|
#21 |
![]() ![]() Developer
|
Fixed JaSo PsP's code
Code:
green = Color.new(0,255,0)
math.randomseed(os.time() )
LotteryNumbers = {2,12,16,19,32,48}
winningNumber = 1
oldpad = Controls.read()
-- Between the quotation marks, put the file path to the image you want to load.
fetch3 = Image.load("image.png")
while true do
screen:clear()
-- Blit the image AFTER you clear the screen
screen:blit(0, 0, fetch3)
pad = Controls.read()
if pad:cross() and oldpad:cross() ~= pad:cross() then
winningNumber = math.random(1,65)
end
if winningNumber == LotteryNumbers[1] then
screenrint(100,100,"YOU WIN!",green)
end
if winningNumber == LotteryNumbers[2] then
screenrint(100,100,"YOU WIN!",green)
end
if winningNumber == LotteryNumbers[3] then
screenrint(100,100,"YOU WIN!",green)
end
if winningNumber == LotteryNumbers[5] then
screenrint(100,100,"YOU WIN!",green)
end
if winningNumber == LotteryNumbers[6] then
screenrint(100,100,"YOU WIN!",green)
end
screenrint(10,10,winningNumber,green)
screen.waitVblankStart()
screen.flip()
oldpad = pad
end
|
|
|
|
|
|
#23 | |
![]() |
Quote:
__________________
...Just Returned To The Scene... |
|
|
|
|
|
|
#25 | |
![]() |
Quote:
__________________
...Just Returned To The Scene... |
|
|
|
|
![]() |
| Tags |
| lua |
| Thread Tools | |
|
|