need help again i got bullet shooting but how do i make it so when it shoots the other player he dies
Printable View
need help again i got bullet shooting but how do i make it so when it shoots the other player he dies
xbullet is the x coordinate of the bulletCode:if xbullet+bullet:width()>=xtarget and ybullet+bullet:height()>=ytarget and ybullet<=ytarget then
health=0
end
ybullet is the y ""
xtarget is the x coordinate for the target
ytarget is the y " "
hi all is it possible to do this?? i dunt have my psp with me, but im makin a sidescroller game, and i want the enemies to be offscreen at first, and then come onscreen.
heres my code: use any picture for enemy:
and i would do this for every enemy i wantedCode:enemy = true
enemyx = 580
enemyy = 120
screen:blit(enemyx, enemyy, enemy)
enemyx = enemyx+2
if enemyx < 0 then
enemy = false
end
Everything would work there, except how you set "enemy" to true and then tried to blit it. I'm not sure if you were going to do this but you first have to load an image, then blit that variable. For example:Zitat:
Zitat von Grimfate126
Unless you were already going to do that, I couldn't exactly tell what you meant. Also, if you don't have your PSP, and even if you do, I would definitely recommend Windows LUAPlayer ( can be found on www.luaplayer.org). This way you can test your app at any stage of development on your computer, view exact errors(along with the line number they are on), and you don't have to eep putting it on your PSP.Code:enemy1 = Image.load("enemy1.png")
enemyx = 580
enemyy = 120
screen:blit(enemyx, enemyy, enemy)
enemyx = enemyx+2
if enemyx < 0 then
enemy = false
end
I wish there was a linux version. It doesnt matter actually cause im gonna go back to windows next week orso. But its a pain in the ass coding because i have to put it back and forth between the pc and psp.
im so off today but thx for that last code altair but now i need to know is this right
ive never done this type of code before what i want it to do is restart the script when the other player gets hit please help! :icon_sad:Code:if health=0 then
break
end
Hey, could anyone give me a PM on this -
I need to make a few bug fixes to my Lua game, but I don't know how the bugs can be fixed. So, I need a tiny bit of help, and my game will be released. Thanks :)
Oh, heres a screenshot of the game in action BTW: its a Rock Paper Scissors game. I don't think that's been done before.
http://i2.tinypic.com/son9l2.jpg
Well if you use that code it will break out of the loop. If there is no loop outside of the loop you break out of, then your game will exit.
Also you have to use two ='s at an if statement. So it becomes:
Code:if health==0 then
break
end
thanks again altair i will give u credit on helping with my game :D
no prob at all and thx!