![]() |
|
#11
|
|||
|
|||
|
Error: Button Input.LUA:52: '<eof>' expected near 'end' Press Start to restart Code:
-- +++++Variables+++++ green = Color.new(0,255,0) red = Color.new(255,0,0) upPressed = 'You are pressing the "UP" button' downPressed = 'You are pressing the "DOWN" button' leftPressed = 'You are pressing the "LEFT" button' rightPressed = 'you are pressing the "RIGHT" button' LPressed = 'You are pressing the "L" button' -- +++++Main Loop+++++ while true do screen:clear() pad = Controls.read() -- these next line of code uses the variables I just made. if pad:up() then screen:print(100,100,upPressed,green) end if pad:down() then screen:print(100,100,downPressed,red) end if pad:left() then screen:print(100,100,leftPressed,green) end if pad:right() then screen:print(100,100,rightPressed,red) end if pad:l() then screen:print(100,100,LPressed,green) end -- Now for those other five buttons. I will write the text directly in the print statement for these, just to practice different methods. if pad:r() then screen:print(100,100,'You are pressing the "R" button',green) end if pad:triangle() then screen:print(100,100,'You are pressing the "TRIANGLE" button',green) end if pad:circle() then screen:print(100,100,'You are pressing the "CIRCLE" button',green) end if pad:cross() then screen:print(100,100,'You are pressing the "X" button',green) end if pad:square() then screen:print(100,100,'You are pressing the "SQUARE" button',green) end screen.waitVblankStart() screen.flip() end
__________________
------------------------------------------------------------------------------------ A true master of control is one who never seems to be in control ------------------------------------------------------------------------------------ |
|
#12
|
|||
|
|||
|
Quote:
Code:
-- +++++Main Loop+++++ while true do screen:clear()
__________________
------------------------------------------------------------------------------------ A true master of control is one who never seems to be in control ------------------------------------------------------------------------------------ |
|
#13
|
||||
|
||||
|
Coo. Hey, if you need some help with errors or how to script something, you can always pm me and I can take a look at it. I'm pretty decent at LUA, and I've got a co-worker that does games in LUA as well.
__________________
![]() PSP = Phat 3.71 m33-4 > 3.90 m33 > 3.90 m33-2 > 3.90 m33-3 > 3.93 GEN w/ 1.50 Kernel Addon > 3.95 GEN > 3.90 m33-3 > 4.01 m33 > 3.90 m33-3 w/ 1.50 Kernel Addon PS2 = Slim Unmodded |
|
#14
|
|||
|
|||
|
hey your words were messed when its myBrithyear it can be MyBrithYear just myBrithyear heres your code
Code:
-- NOTES -- Green Color Object green = Color.new(0, 255, 0) -- Store birth year in variable myBirthYear myBirthyear = 1991 -- Store current year in currentYear currentYear = 2008 -- create an empty variable myAge = nil -- Store some text in a variable (Note the space after the last word before the end ") someText = "My age is roughly " -- Subtract myBirthYear from currentYear and store in myAge myAge = currentYear - myBirthyear -- Print our text variable to the screen screen:print(10,100, someText ,green) -- Buffer offscreen to onscreen (If this was a human, offscreen would be thinking about it, onscreen would be saying it) screen.flip() -- Loop forever while true do screen.waitVblankStart() end
__________________
![]() Email me your lua scripts ill fix them or help you fix them and Email you back on what you wanted :D |
|
#15
|
|||
|
|||
|
dont mess with while true do
__________________
![]() Email me your lua scripts ill fix them or help you fix them and Email you back on what you wanted :D |
![]() |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|