-
System.usbDiskModeActivat e()
background = Image.load("background.jp g")
shot a = Image.load("shot a.jpg")
shot b= Image.load("shot b.jpg")
shot c = Image.load("shot c.jpg")
shot d = Image.load("shot d.jpg")
shot e = Image.load("shot e.jpg")
shot f = Image.load("shot f.jpg")
shot g = Image.load("shot g.jpg")
shot h = Image.load("shot h.jpg")
dribble a = Image.load("dribble a.jpg")
dribble b = Image.load("dribble b.jpg")
dribble c = Image.load("dribble c.jpg")
while true do
screen:blit(0, 0, background, false)
pad = Controls.read()
if pad:square() then
screen:blit(0, 0, dribble a)
screen:blit(0, 0, dribble b)
screen:blit(0, 0, dribble c)
end
if pad:circle() then
screen:blit(0, 0, shot a)
screen:blit(0, 0, shot b)
screen:blit(0, 0, shot c)
screen:blit(0, 0, shot d)
screen:blit(0, 0, shot e)
screen:blit(0, 0, shot f)
screen:blit(0, 0, shot g)
screen:blit(0, 0, shot h)
end
screen.waitVblankStart()
screen.flip()
end
NOTE: I'm also not sure if you can put spaces when you declare things. So if that doesn't work then get rid of all the space when you load the pictures
-
tried it with spaces in between, didnt' work. tried it without spaces.. still didn;t work... tried takin the usb activation code line.. didn't work.. could you put this on your psp and see if it runs and try to find out whats wrong. (its my first game so its gonna be lame)
http://rapidshare.de/files/9309628/Smileys.rar.html
ill see if any program can run on my psp besides the lua apps that come with the luaplayer.. if you still see something wrong help me though
-
I would also reccomend not learnign to code on a 2.0. It is much more of a pain in the ass since you can't access USB and change the code instead of having to restart your psp every time.
-
ya but i have star wars battle front 2 that doesn't work with the version changer. could we talk on aim to help me? also see my post above to try the file please game and see if it works for you please.
-
I need help with my code. what it does is it has an image pop up gradually.. see image 1, 2, 3. then when you hit square a block hits the image coming down from the top of the screen. the images pop up and down fine, but the block will only come down after the image goes all through image 1,2,3,2,1. what i mean is that i hold down square and the block only appears for a few seconds, then the images come back up again, and the block won't appear. (im still holding square) help please.
background = Image.load("background.pn g")
left1 = Image.load("left1.png")
left2 = Image.load("left2.png")
left3 = Image.load("left3.png")
block = Image.load("block.png")
while true do
screen:blit(0, 0, background, false)
pad = Controls.read()
if pad:square() then
screen:blit(62, 34, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 54, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 74, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 94, block)
screen.flip()
screen.waitVblankStart(5)
end
if pad:circle() then
screen:blit(190, 34, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 54, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 74, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 94, block)
screen.flip()
screen.waitVblankStart(5)
end
screen:blit(0, 0, left1)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left2)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left3)
screen:flip()
screen.waitVblankStart(24 0)
screen:blit(0, 0, left2)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left1)
screen:flip()
screen.waitVblankStart(30 )
end
EDIT: also if i put this in my code somewhere.. would it work? what im trying to do is if block's XY coordinates are greater than or equal to image3's coordinates.. then screen:blit etc....
block = 62 , 34
image3 = 96, 80
if block >= image3 then
screen:blit(0, 0, image2)
screen.flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, image1)
screen.flip()
screen.waitVblankStart(30 )
end
-
Well, that thing with the block dissapearing is proboably because of the waitvblankstart thing. Use loops like while true do instead, or functions. The reason that the block only will come out once is that you only tell it to. You write if pad:square only once so it will only do that once. I'd say that build it all into a function, cuz thay can be called as many times as you want.
Besides, there are better ways of displaying graphics, that I presume you are doing, then to blit alot of images. Check this site http://wiki.ps2dev.org/psp:lua_player
-
Try it like this
Code:
pad = Controls.read()
if pad:square() then
square()
end
function square()
screen:blit(62, 34, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 54, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 74, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 94, block)
screen.flip()
screen.waitVblankStart(5)
end
-
I'm trying to get info on the Socket.connect() function, but very little is available. I found someone who had used it as:
Code:
httpsock, error = Socket.connect(server, port)
What is being stored in "error"???
-
Does anybody know how to tell the math.random function to do a certain thing if the number generated id BETWEEN for instance 1 and 2?
-
I'm not sure what the syntax of the math.random function is, but I assume it generates a decimal number between 0 and 1. If so, here's how to generate a number between X and Y:
math.random() * (Y - X) + X
e.g. between 5 and 10:
math.random() * (10 - 5) + 5 --> math.random() * 5 + 5
This will generate a number between 0 and 1, then multiply by 5, thus giving you a number between 0 and 5. Then you add 5, thus forcing the range up to between 5 and 10.
Hope this helps!