how complex is the code, what game is it, depends on the game.
Printable View
how complex is the code, what game is it, depends on the game.
Hey people, I'm stuck with my game. The coding goes perfect but I want to make a option, that pauses the game if you press start. There's a lot of action in my game so
I really do need a pause option so people can take a break, or just want to stop for a while.
I searched google but didn't find anything.
Something like this:
Code:if pad:start() then
--Pause Game (Show An Image And Pause Game)
end
u need to create a simple variable like so:
pause = 1;
than anything that increments simple multiply it by the pause variable
and if u want to pause:
and that creates the pause state, simple do an if pause==0 then //menu hereCode:if pad:start() then
--thanks dan for pointing out that it's ~, instead of !
pause ~= pause;
end
Isn't '!pause' for C?
In Lua it's '~=' So it would be
Code:
pause ~= pause;
sorry, haven't used lua in a long time, it's why i said for someone to correct me if i'm wrong, and it's for many other languages than just C, but it's the major one for homebrew, so yes
Does somebody know where I can find a sample, or post a sample?
Is this code right:
Code:if pad:start() then
pause ~= pause;
screen:blit("0,0, pause")
end
pause = not pause
I don't understand. How is the code got to be then?
Simple.
Say you have a boolean called pause,
then you have your if statement,
then another simple if statementCode:
if press sumthing then
pause = true
end
Basically if pause then do things, pause would either be true Or false. When you press say start it would make it true, then that if comes into play.Code:if pause then
blit watever
end
Then have another If checking e.g
if pause is true & you set it to not pause (or any boolean) then it basically means the opposite, so pause would be......... (i know but i want malliet to answer, see if he understands)Code:
if pad:cross() then
pause = not pause
end
Hi there!
Is there any way to merge the source of my lua game into the eboot.pbp? I don't want the people to complain about my style in writing games :(
Thanks in advance!
from: http://forums.qj.net/psp-development-forum/146185-lua-development-help.html
and if you still want to do it:
hopefully that helps you, and next time try to search first=-), and lastly if you manage to accompalish what you wanted to do, than don't listen to people complaining about your code, it only happens if you release something really, really pointless, and easy to do with a few lines of lua
Why don't you want people criticising your code? People don't just say "ZOMG HIS CODZ SUCK LOLOLO U SUCK!!!!!!!!!!!!!11111", most people will give you helpful suggestions and advice for improving yourself.
Besides, if you have bad code and you just bytecode your app, people will then just complain about the fact that it is bytecoded.
how do u load a .wav file in luaplayer? please help
thanks malliet :)
-=Double Post Merge =-
well now i have a problem my psp freezes look at my code please see if anythings wrong
korn = Sound.load("Music/korn.wav")
if pad:l() then
korn:"without these quotes"play()
end
theres more code in between but these are what im haveing trouble with
i figured out what was wrong but i still need help its my wav file i loaded up another one and it worked but i cant get my korn.wav to work
k thanks
Is there a drag and drop function?
Its in the LPHM Readme
How would I go about rotating images?
Thanks
Hi. I was wondering if there is a lua adhoc file transfer program out there, somewhere?
If not, it would be possible, right? Theoretically..
It would be easy to accomplish, but there are already better ones in C....
I know, I use one. But I was wanting to get one in lua so I could look at it and learn from it.
I've been curious how it would work, and since lua is a simple language, it would be easier to understand one written in lua.
I've also wondered.. if a psp was receiving data from adhoc, and 2 other psp's were sending different data at the same time... would it get jumbled up?
I would say try it out:D
not in lua player hm it doesnt
Really? I'm pretty sure it's an internal thing...
well, thats kinda why I'm asking.. I can't. I only have 2 psp's and one's wifi card is broken.
I would think that it wouldn't get results from 2 psp's in one "Adhoc.recv()" call, but I think there is a chance that the next time you call "Adhoc.recv()" it could get results from a completely different psp.
I bet there is someone who's experimented with this and figured it out.. are there any 3 or more player games in Lua using adhoc?
All I've seen are 2 player i think.