Pllease post you code :D
Printable View
Pllease post you code :D
Its good I messed around and fixed it but I get the [colo=Black]****ING LOOP IN GETTABLE NOW[/black] on the lines with "--Loop In gettable" next to emAnd the stick.x stuff has to be like that otherwise the player wont moveCode:black = Color.new(0,0,0)
red = Color.new(255,0,0)
stick = {}
stick.x = 240
stick.y = 200
life = 1
coll = 0
y = 0
speed = 3
spike = Image.load("spike.png")
bg = Image.load("background.png")
death = Image.load("death.png")
stick = Image.load("stick.png")
math.randomseed(os.time())
x = math.random(480 - spike:height())
while true do
screen:clear()
screen:blit(0, 0, bg, false)
screen:blit(stick.x, stick.y, stick) --Loop in gettable
pad = Controls.read()
screen:print(0, 240, "Speed: " .. speed, black)
screen:blit(x, y, spike)
if not paused then
screen:print(0, 250, "UNPAUSED", black)
y = y + speed
if y + spike:height() >= 272 then
screen:print(x, y - 10, "OUCH!", red)
y = 0
x = math.random(480 - spike:height())
screen.flip()
System.sleep(2000)
end
else
screen:print(0, 250, "PAUSED", red)
end
if pad:cross() and pad ~= oldpad then if paused then paused = false else
paused = true end end
if pad:up() and pad ~= oldpad then speed = speed + 1 end
if pad:down() and pad ~= oldpad then speed = speed - 1 end
if pad:left() and pad ~= oldpad then --Loop In gettable
stick.x = stick.x - 2
end
if pad:right() and pad ~= oldpad then -- Loop in gettable
stick.x = stick.x + 2
end
oldpad = pad
screen.flip()
screen.waitVblankStart()
end
LUA PLAYER BUG?
If you do like this:
It obviously plays the bgsound.Code:if BGSoundTimer >= 1 then
BGSound:play()
BGSoundTimer = 0
end
But if you have any other sound that starts exactly when "BGSound" stops, then BGSound just stop looping, just stops.
It drives me nuts, because i really want to finnish my game!
Why don't you useZitat:
Zitat von MaSt3r_ShAk3
That might fix the problem.Code:if pad:right() and
oldpad:right() ~= pad:right() then
stick.x = stick.x + 2
end
i still get the error for theCode:screen:blit(stick.x, stick.y, stick) --Loop in gettable
i'm getting loop for gettable with...
Code:monster = Sound.load("sounds/monsterkill.wav",false)
voice = monster
monster:stop() -- this gives loop gettable thing
luaplayer dosnt understand what monster means because monster is not a command.Zitat:
Zitat von Rixorster
He assigned monster to the sound he loaded
ok, this is getting annoying. i keep trying to make start resart the game im working on, nad every time i get
no loop to break near end
and my code is this
if pad:start() then
break
end
ive tried it withall versions .10 and up, and ive tried it with all buttons. plz help
ps. does ne one know where to get lua player 0.09?
That's because there is no loop to break.Zitat:
Zitat von qwerty
i rather would use:
To refresh the program, while creationg something in lua.Code:if pad:start() then
dofile "index.lua"
end