Nothing I can do about that. Looks like LuaPlayer syncs to the memory card when the file is closed whcih ensures that the data is written to card and flushes the buffer. I wouldn't have thought it be 10 secs though.
Printable View
Nothing I can do about that. Looks like LuaPlayer syncs to the memory card when the file is closed whcih ensures that the data is written to card and flushes the buffer. I wouldn't have thought it be 10 secs though.
i now just need to know, when the game ends, and it says game over, how to i make triangle make the game restart? what tells the game to restart?
-= Double Post =-
nah thats sorted.Zitat:
Zitat von head_54us
-= Double Post =-
finished game...
restart button
put this in/near your game over function/loop
Code:if pad:triangle() then
dofile(".index.lua")
end
I keep getting this weird error:
Heres my code:
Heres my error:Zitat:
-- Alien Cross Hair Menu Screen
-- Create Colors
white = Color.new(255,255,255)
red = Color.new(255,69,0, 195)
-- Load Background
Background_Menu = Image.load("./Images/back_menu.png")
-- Load Arrow Image
arrow = Image.load("./Images/arrow_down.png")
-- The Loop
while true do
screen:blit(0,0,Backgroun d_Menu)
screen:blit(208,193,arrow )
oldpad = Controls.read()
pad = Controls.read()
-- Prints our 4 menu options
screen:print(208,96,"Star t Game",white)
screen:print(128,144,"Cre dits",white)
screen:print(208,192,"How To Play",white)
screen:print(288,144,"Exi t To XMB",white)
-- These make it so when the variable "current" changes
-- so does the current menu selection
if current == 1 then
screen:print(208,96,"Star t Game",red)
screen:blit(208,97,arrow)
end
if current == 2 then
screen:print(128,144,"Cre dits",red)
screen:blit(128,145,arrow )
end
if current == 3 then
screen:print(208,192,"How To Play",red)
end
if current == 4 then
screen:print(288,144,"Exi t To XMB",red)
screen:blit(288,145,arrow )
end
if pad:up then
current = 1
end
if pad:left then
current = 2
end
if pad:down then
current = 3
end
if pad:right then
current = 4
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end
Error: menu.lua:45: function arguments expected near /then/
??????
if pad:down() then
if pad:left() then
if pad:right() then
if pad:left() then
You have to have function arguments after buttons.
-= Double Post =-
http://evilmana.com/tutorials/codebase/simple_menu.php
I would use that to make a menu. It's much better.
Hey guys, sorry for that long code, I figured out the problem, I just forgot to put the () infront of my pads :D
LOL, aha.
EDIT:
aww, someone beat me to it.
Hold on, I have another question.
Whats the correct coding for getting back to the XMB?
there is no code to get back to XMB from luaplayer. but you can the eboot from the modded luaplayer and use the System.Quit() command as LMelior stated before.. PM me if you need help with that.
where does it actually define the variable 'current'?
ok...
you know how when u screen:blit it makes the image show up?
well is there a way you can do the opposite?
like i want it so when i press r my first image dissapeers and a new one comes up.
i have thing sort of working but when i press r the new image shows up just on top of the old one. and they both continue to like they are spossed too.
please tell me what i have to do to make the original dissapear when r is pressed. here is my code..
Player = { }
Player[1] = { x = 200, y = 197 }
while true do
pad = Controls.read()
screen:clear()
screen:blit(Player[1].x,Player[1].y,player)
if pad:l() and Player[1].x > 0 then
Player[1].x = Player[1].x - 2
end
if pad:r() and Player[1].x < screenwidth then
Player[1].x = Player[1].x + 2
screen:blit(Player[1].x,Player[1].y,player2)
end
@ Jamz, when you blit an image it isnt actually written to the screen. Its written to the buffer. When flip.Screen is executed the buffer is drawn to the screen. So you put what you want blitted in an if loop. I dont know lua, but ill try.
Code:
if playerblit = 1 then
//* Blit code for player.
end
//* Then set up a pad input so that if R is pressed playerblit equals 0