![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on lua scripts? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; how do you implement high-scores and menus into my lua game?(it isnt realeased to the public just yet) also i ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() likes kittens....awww....
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
|
how do you implement high-scores and menus into my lua game?(it isnt realeased to the public just yet)
also i need a GFX guy and some guys were impersonating me as (Unregistered) |
|
|
|
|
|
#2 |
![]() ![]() Mindless Self Indulgence
|
highscore is like
define a variable of points... so after u die something like IF points > Old points then highscore = points and menu can be like if pad:cross then start game... or if pad:cross then option+1
__________________
PSN:realn0whereman NEW MSI ALBUM APRIL 29TH: IF *orgasm* ![]() |
|
|
|
|
|
#4 |
![]() ![]() I'm Baaaack!
|
Go to evilmana.com and go to the Lua CodeBase. There are many little menu tutorials there. As for the highscore. Try this.
First create a .txt file. Something like "highscore.txt" At the very beginning you want to do this: high = io.open("highscore.txt"," r") highscore = high:read() high:close() Now you want a variable for your points. points = 0 Now when the game is over, do this. if points > highscore then high2 = io.open("highscore.txt"," w") high2:write(points) high2:close() end This will save the highscore to the .txt file, and it will load the highscore next time you play.
__________________
|
|
|
|
|
|
#7 |
![]() ![]() sceKernelExitGame();
|
Pretty much, keep the score in a variable... Then when the game is complete ro whenever you want to save the score use dofile() to save it into another .txt file
__________________
|
|
|
|
|
|
#8 |
![]() likes kittens....awww....
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
|
also how do you do a screen:/print function with a truetype font???
becuz i have the font loaded like this red = Color.new(255,0,0) font = Font Font.load(/DATA/FONT/font.ttf) but how do i print text on the screen wit the custom font??? ARza THX 4 all of the help Last edited by psphacker12.; 09-09-2006 at 08:16 AM.. |
|
|
|
|
|
#9 |
![]() ![]() I'm Baaaack!
|
I think it's
font = Font.load(DATA/FONT/font.ttf) You don't need to put FONT twice. And I think to print with that font, you need to do something like: screen:fontPrint(proporti onal, 0, 20, "Hello", blue) I think it's like that. I've never used a ttf font. I'll check up on it later, but for now I have to go.
__________________
|
|
|
|
![]() |
| Tags |
| lua , scripts |
| Thread Tools | |
|
|