The above video goes away if you are a member and logged in, so log in now!

 Would you like to get all the newest Gaming News fromQJ.NET in your email each day? Want to learn more about the team who brings you the QJ news?

## lua help

This is a discussion on lua help within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; There is no &quot;System.Quit()&quot; in the default luaplayer, so I recomend not encouraging it to n00bs because they dont know ...

 Tweet
1. There is no "System.Quit()" in the default luaplayer, so I recomend not encouraging it to n00bs because they dont know that. Besides, when someone quits the game, they would want to go to the LOWSER not back to the XMB to relaunch lua...

2. Originally Posted by youresam
Uh, no.
http://forums.qj.net/members/28930-zx30.html
I took that and ran it through a lua program I made....removed a frame...sped it up...and there you go.

Ontopic: Make sure you are adding the values, not setting the X and Y equal to the analogs position. Also remember to divide the analog by like 100.
Never divide. Multiply by the inverse, especially in Lua:
Code:
1/4 == 1*0.25f

3. Originally Posted by SG57
Never divide. Multiply by the inverse, especially in Lua:
Code:
1/4 == 1*0.25f
And why is that?
-= Double Post =-
I see.

4. ok...i got a challenge for you guys???lol
who thinks they can add bullet functionality to my spacecraft????
if anyone is up for it this is the source code for the main game
(sorry if its all crapy but its my first game and it seems to work so far:) dont mind my notes to myself..lol)

green = Color.new(0,255,0)
blue = Color.new(0,0,255)
red = Color.new(255,0,0)
white = Color.new(255,255,255)

--health bar---
healthbar = {}
healthbar.y = 10
player = {}
player.health = 100
death = {0}

Score = 0
exitgame =0
Room_width = 480
Room_height = 272
player1x =170
player1y =190

---player1----

------functions
function checkcontrols()
player1x = player1x +4
end
player1x = player1x -4
end
player1y = player1y -4
end
player1y = player1y +4
end

function drawall()
screen:blit(player1x,play er1y,player1)

end
end

---end player----
size = 200
zMax = 5
speed = 0.1

width = 480
height = 272

starfield = {}
math.randomseed(os.time() )

function createStar(i)
starfield[i] = {}
starfield[i].x = math.random(2*width) - width
starfield[i].y = math.random(2*height) - height
starfield[i].z = zMax
end

for i = 1, size do
createStar(i)
starfield[i].z = math.random(zMax)
end

white = Color.new(255, 255, 255)
black = Color.new(0, 0, 0)
---music---
voice = 0

Music.volume(100)
SoundSystem.SFXVolume(128 ) -- max
SoundSystem.reverb(4) -- out of 15
SoundSystem.panoramicSepa ration(128) -- 0 is mono
Music.playFile("music.xm" , true)
while true do
screen:clear(black)
screen:fillRect(10,10,pla yer.health,healthbar.y,re d)
screenrint(10,30,player.health, white)
player.health = player.health+0.5
end
player.health = player.health -0.5
end

for i = 1, size do
starfield[i].z = starfield[i].z - speed
if starfield[i].z < speed then createStar(i) end
x = width / 2 + starfield[i].x / starfield[i].z
y = height / 2 + starfield[i].y / starfield[i].z
if x < 0 or y < 0 or x >= width or y >= height then
createStar(i)
else
screenixel(x, y, white)
end
end

checkcontrols()
drawall()
Music.volume(96)

screenrint(400,0,"score:", blue)
screen.waitVblankStart()
screen.flip()
---take screenshot-----
if pad:select() then screen:save("screenshot.j pg") end
----you lose----
if player.health == death[1] then
screenrint(100,100,"you lose", blue)
end
---exit game-----
Music.stop()
break end
end

Page 2 of 2 First 1 2

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

All times are GMT -8. The time now is 10:15 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY