![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on loop is gettable? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; ok im not going to bother with explaing heres the code Code: -- Gears of War, linkinworm/C98, superdan06/SO6, copyright Epic ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
ok im not going to bother with explaing heres the code
Code:
-- Gears of War, linkinworm/C98, superdan06/SO6, copyright Epic gameing studios and microsoft gameing studios
-- codeing start date 1st october 2007
-- note option 1,2,3 does now have an exit option press O to exit
-- this does not save anything to the memstick,
-- exit does now work thanks to waywardson for help
-- revision pre-alpha 0.2
-- thanks to pickdat and homemister91 for the excelent mp3 support, and for all future releases
GB = Image.load("GEARS BK.png")
Mp3me.load("06 Fish In a Barrel.mp3")
Mp3me.play()
--Colors
white = Color.new(255,255,255)
red = Color.new(255,0,0)
fontcolor = Color.new(255,0,0)
Font = Font.load("GoW.ttf")
Font:setPixelSizes(20,20)
current = 1 --this is current menu selection
oldpad = Controls.read()
while true do
pad = Controls.read()
screen:clear()
screen:blit(0, 0, GB)
if pad:cross() and current == 1 then
Music.stop()
dofile("MAIN_GAME.lua")
end
if pad:cross() and current == 2 then
Music.stop()
dofile("PONG_OPTIONS.lua")
end
if pad:cross() and current == 3 then
Music.stop()
dofile("image.lua")
end
if pad:cross() and current == 4 then
Music.stop()
dofile("pong.lua")
end
if pad:cross() and current == 5 then
Music.stop()
dofile("GoW.lua")
end
if pad:cross() and current == 6 then
Music.stop()
dofile("SMK.lua")
end
if pad:cross() and current == 7 then
Music.stop()
System:Quit()
end
--menu options
screen:fontPrint(Font,240,100,"Start Main Game",fontcolor)
screen:print(240,110,"PONG",white)
screen:print(240,120,"High Scores",white)
screen:print(240,130,"Cheats",white)
screen:print(240,140,"start gears of war",white)
screen:print(240,150,"Super mario kart",white)
screen:print(240,160,"Exit To XMB",white)
screen:print(170,200,"From DARC STUDIOS",red)
screen:print(170,210,"Codeing C98, Animation SO6",red)
if Music.playing() == true then
screen:print(10,10,"Music is playing",white)
end
-- These make it so when the variable "current" changes
-- so does the current menu selection
if current == 1 then
screen:print(240,100,"Start Main Game",red)
end
if current == 2 then
screen:print(240,110,"PONG",red)
end
if current == 3 then
screen:print(240,120,"High Scores",red)
end
if current == 4 then
screen:print(240,130,"Cheats",red)
end
if current == 5 then
screen:print(240,140,"start gears of war",red)
end
if current == 6 then
screen:print(240,150,"Super mario kart",red)
end
if current == 7 then
screen:print(240,160,"Exit To XMB",red)
end
if pad:up() and oldpad:up() ~= pad:up() then
current = current - 1
end
if pad:down() and oldpad:down() ~= pad:down() then
current = current + 1
end
--Makes it so the selection goes from the bottom to top
if current == 8 then
current = 1
end
if current == 0 then
current = 7
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end
i have no idea whats wrong, because it was working befor i edited my index file, im getting really fed up with this now, becaue iv spent the last 4 hours sorting error and crap, this isnt even the main code, its just a crappy menu that iv been trying to get a font and mp3 to work with.*sigh* |
|
|
|
|
|
#2 |
![]() Enter Custom Title
|
have you tried renaming Font to something else
Code:
blah = Font.load("goW.ttf")
blah:setPixelSizes(20,20)
|
|
|
|
|
|
#4 |
![]() Developer and Tutor.
My Mood:
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
|
you know the lua help thread is there for a reason
one so you dont get thousands of lua help me spam threads and two because that is where people first look to help you ill look over your code and tell you whats wrong
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference. My Website: is down for a while ... I'll bring a new one back soon. Currently working on: (0) PGE Gears Of War - On hold (Very large project). (0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix). |
|
|
|
|
|
#5 | |
![]() |
Quote:
|
|
|
|
|
|
|
#7 |
![]() |
See how you named your font simply, "Font"?
See how Font is already the table with all the font functions in it? When you named your font, "Font", you removed all the Font stuff that was there, making it error. Name your font something else. |
|
|
|
|
|
#8 |
![]() Developer and Tutor.
My Mood:
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
|
Code:
Font = Font.load("GoW.ttf")
Font:setPixelSizes(20,20)
Code:
myfont = Font.load("GoW.ttf")
myfont:setPixelSizes(20,20)
go here linkage http://wiki.ps2dev.org/psp:lua_player:functions
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference. My Website: is down for a while ... I'll bring a new one back soon. Currently working on: (0) PGE Gears Of War - On hold (Very large project). (0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix). |
|
|
|
|
|
#12 |
![]() Developer and Tutor.
My Mood:
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
|
omg you phail you have not enough end's in your file as in you forgot to close an if you dont even need to tell me the error properly to make me know you are an lua spak, just go learn it properly and format your code or learn how to it will help
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference. My Website: is down for a while ... I'll bring a new one back soon. Currently working on: (0) PGE Gears Of War - On hold (Very large project). (0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix). |
|
|
|
|
|
#13 |
![]() |
well this works when i dont use a font, but i really want to use because i dont have time to be creating images with the same font
i do have enough ends, because it works fine now. i did actualy have the font working at one point, i have it working on my other file perfect. |
|
|
|
|
|
#15 |
![]() |
i already said that doesnt work for me, i used Font in a different file and it works fine
Code:
Menu_Background = Image.load("GEARS BK.png")
GB = Image.load("GEARS BK.png")-- place holder pic of full screen
GMB = Image.load("GEARS_menu_background.png")
Mp3me.load("01 Gears of War.mp3")
Mp3me.play()
Font = Font.load("GoW.ttf")
Font:setPixelSizes(20,20)
--Colors
white = Color.new(255,255,255)
red = Color.new(255,0,0)
pink = Color.new(255, 0 , 153)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0)
fontcolor = Color.new(255,0,0)
current = 1 --this is our current menu selection
oldpad = Controls.read()
while true do
pad = Controls.read()
screen:clear()
screen:blit(0, 0, GMB)
if pad:start() and current == 1 then
Mp3me.stop()
dofile("menu.lua")
end
screen:fontPrint(Font,250,140,"PRESS START",fontcolor)
screen:print(1,250,"Linkinworm",red)
screen:print(1,258,"C98",red)
screen:print(405,250,"Supadan06",red)
screen:print(449,258,"SO6",red)
screen:print(200,258,"DARC STUDIOS",red)
screen.waitVblankStart()
screen.flip()
oldpad = pad
end
|
|
|
|
|
|
#16 |
![]() ![]() Developer
|
Rename the variable you use to store the font in ALL scripts you are using/dofiling/whatever.
__________________
[Blog] [Portfolio] [Homebrew Illuminati - Serious Homebrew Development Forums] [I want to make Homebrew FAQ] [How I broke into the Games Industry] [Programming Book List] [Programming Article List] |
|
|
|
|
|
#18 | ||
![]() Enter Custom Title
|
this is your third lua help thread in a short amount of time...u should really post in the stikied lua help thread or your going to get a lot of bashing on you
__________________
http://img489.imageshack.us/img489/5841/99862310tg8.jpg Quote:
Quote:
|
||
|
|
|
|
|
#19 | |
![]() Developer and Tutor.
My Mood:
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
|
Quote:
my email is fatboycg@hotmail.co.uk if you need simple lessons then i will be glad to give you lessons on msn when i have time but please just take this post and all of the above into mind thanks F@T3oYCG
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference. My Website: is down for a while ... I'll bring a new one back soon. Currently working on: (0) PGE Gears Of War - On hold (Very large project). (0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix). |
|
|
|
|
|
|
#20 | |
![]() Enter Custom Title
|
Quote:
Please start using grammar, it is becoming increasingly difficult to read your posts. Maybe you should take a rest from LUA and look up what a full stop is. |
|
|
|
|
|
|
#21 | |
![]() Developer and Tutor.
My Mood:
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
|
Quote:
It is not hard to format a sentence correctly, but some people may choose not to. I choose not to use full grammar because it takes too long, also i am not writing anything that requires me to. Hence the reason why this post took so long.
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference. My Website: is down for a while ... I'll bring a new one back soon. Currently working on: (0) PGE Gears Of War - On hold (Very large project). (0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix). |
|
|
|
|
|
|
#22 | |
![]() Enter Custom Title
|
Quote:
|
|
|
|
|
|
|
#24 | |
![]() |
Quote:
Code:
GB = Image.load("GEARS BK.PNG")
red = Color.new(255,0,0)
white = Color.new(255,255,255)
gears = Font.load("GoW.ttf")
gears:setPixelSizes(20,20)
current = 1
oldpad = Controls.read()
while true do
pad = Controls.read()
screen:clear()
if pad:cross() and current == 1 then
dofile("MAIN_GAME.lua")
end
if pad:cross() and current == 2 then
dofile("PONG_OPTIONS.lua")
end
if pad:cross() and current == 3 then
System.Quit()
end
screen:clear()
screen:blit(0, 0, GB)
screen:fontPrint(gears,250,120,"Start Main Game",red)
screen:fontPrint(gears,250,135,"Pong",red)
screen:fontPrint(gears,250,150,"Exit",red)
if current == 1 then
screen:fontPrint(gears,250,120,"Start Main Game",white)
end
if current == 2 then
screen:fontPrint(gears,250,135,"Pong",white)
end
if current == 3 then
screen:fontPrint(gears,250,150,"Exit",white)
end
if pad:up() and oldpad:up() ~= pad:up() then
current = current -1
end
if pad:down() and oldpad:down() ~= pad:down() then
current = current + 1
end
if current == 4 then
current = 1
end
if current == 0 then
current = 3
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end
http://youtube.com/watch?v=jAgz279M_1A -= Double Post =- dont matter now if fixed it on my own anyway Last edited by linkinworm; 04-01-2008 at 02:32 PM.. Reason: Automerged Doublepost |
|
|
|
|
![]() |
| Tags |
| gettable , loop |
| Thread Tools | |
|
|