k thanxZitat:
Zitat von MagicianFB
Printable View
k thanxZitat:
Zitat von MagicianFB
In Lua tutorial 2 you can display pic's when you push a button. But how do I do so the image doesn't disapear directly after a stop pushing the button??I want the picture/text to stay there.
And how do I change the size of the text/numers in my program??
Thanks in advance!
can u post ur code??
Hi i really need some help here.
My new game Dragon Ball Portable is very dodgy.
It skatter's around.
Is the code alright?
(Please nobody steal this)
How can i get the Picture to move up aswell???
Code:--c5cha7's DBP (Beta source)
--activate usb
System.usbDiskModeActivate()
--load text colors
red = Color.new(255, 0, 0)
blue = Color.new(0, 0, 255)
green = Color.new(0, 255, 0)
black = Color.new(0, 0, 0)
white = Color.new(255, 255, 255)
--Startup
intro = Sound.load("Data/Sounds/intro.wav")
luaplayer = Image.load("Data/images/lua.png")
intro:play()
screen:blit(0, 0, luaplayer)
screen.flip(120)
screen.waitVblankStart(120)
-- Move Player
function move()
local limit = -11 -- adjust the count limit as needed
local pad = Controls.read()
if (pad ~= oldpad) or (countpads > limit) then
if pad:right() then
playerPos = playerPos + 1
if playerPos > 13 then playerPos = 13 end
screen.waitVblankStart(2)
end
if pad:left() then
playerPos = playerPos - 1
if playerPos < 0 then playerPos = 0 end
screen.waitVblankStart(2)
end
if pad:up() then
playerPos = playerPos - 1
if playerPos < 1 then playerPos = 1 end
end
if pad == oldpad then
countpads = limit - 1 -- for repeatedly advanced
else
countpads = 0 -- for the first pressed
end
oldpad = pad
else -- do nothing for a moment
countpads = countpads + 1
screen.waitVblankStart(5)
screen.waitVblankStart(4)
screen.waitVblankStart(1)
end
end
player = Image.load "player.png"
playerPos = 1
countpads = 0
while true do
screen:clear()
move()
screen:blit(32*playerPos, 120, player)
screen.waitVblankStart()
screen:flip()
end
Sorry I forgot to post the code Here it is:Code:System.usbDiskModeActivate()
blue = Color.new(0, 0, 255)
orange = Color.new(223, 88, 6)
grey = Color.new(94, 97, 111)
yellow = Color.new(255, 255, 0)
black = Color.new(0, 0, 0)
white = Color.new(255, 255, 255)
x = 96
y = 96
speed = 3
while true do
screen:clear()
pad = Controls.read()
screen:print(x, y, "+", white)
if pad:select() then screen:save("screenshot.tga") end
if pad:start() then
break
end
if pad:analogX() < -30 then
x = x - speed
end
if pad:analogX() > 30 then
x = x + speed
end
if pad:analogY() < -30 then
y = y - speed
end
if pad:analogY() > 30 then
y = y + speed
end
if pad:left() then
x = x - 3
end
if pad:right() then
x = x + 3
end
if pad:up() then
y = y - 3
end
if pad:down() then
y = y + 3
end
if pad:start() then
break
end
if pad:cross() then
screen:print(20, 18, "1", white)
end
screen.waitVblankStart()
screen.flip()
end
What are the sound limitations in lua?..
I've been trying to make some background music, but what should it be in?
I've got various wavs playing on events but they fail to play when I try to start them at the main menu. I just want some background music.
Cheers.
They can only be wavs.Zitat:
Zitat von Bilo
Well in that case, there is something wrong as the background audio I have wont play and it's a wav.
Post your script.Zitat:
Zitat von Bilo
Anyone who can help me with my qustion above??