QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

Lua Player Game/App Help

This is a discussion on Lua Player Game/App Help within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi i wanna make a lua program (Unsure about game) And i successfully made my first SUPER HELLO WORLD Here's ...

Reply
 
LinkBack Thread Tools
Old 09-20-2005, 08:59 AM   #1
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default Lua Player Game/App Help

Hi i wanna make a lua program (Unsure about game)
And i successfully made my first SUPER HELLO WORLD
Here's the code to the super hello world.
PHP Code:
green = Color.new(0, 255, 0)
yellow = Color.new(255, 255, 0)
red = Color.new(255, 0, 0);
black = Color.new(0, 0, 0);
white = Color.new(255, 255, 255);

screen:print(194, 136, "Loading: 30%", yellow)
screen.flip()
screen.waitVblankStart(60)

screen:print(194, 126, "Loading: 60%", yellow)
screen.flip()
screen.waitVblankStart(60)

screen:print(194, 116, "Loading: 100%", yellow)
screen.flip()
screen.waitVblankStart(60)

time = 0
pi
= math.atan(1) * 4
background
= Image.load("background.png")
smiley = Image.load("smiley.png")
helloworld = Image.load("helloworld.png")
while
true do
    
screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)

    
x = math.sin(pi * 2 / 250 * time) * 200 + 220.5
    y
= 172 - math.abs(math.sin(pi * 2 / 125 * time) * 150)
    
screen:blit(x, y, smiley)
    
time = time + 1
    
if time >= 500 then
        time
= 0

    screen
:blit(0, 0, helloworld, 0, 0, helloworld:width(), helloworld:height(), false)
screen:print(170, 136, "c5cha7's Hello World!", green)
screen.flip()
screen.waitVblankStart(440)
    
end

    screen
.waitVblankStart()
    
screen.flip()

    
pad = Controls.read()
    if
pad:start() then
        
break
    
end
end
But know i am making a PSP XMB Player.
What it doe's is make's a Window's XP Feeling to your PSP
But i cannot get it to run so here's the code if anyone can help.
PHP Code:
green = Color.new(0, 255, 0)
yellow = Color.new(255, 255, 0)
red = Color.new(255, 0, 0);
black = Color.new(0, 0, 0);
white = Color.new(255, 255, 255);

    
mainmenuimg = Image.load("Data/Images/mainmenu.png")
    
optionmenuimg = Image.load("Data/Images/optionmenu.png")
    
menupointerimg = Image.load("Data/Images/menupointer.png")
    
mouse = Image.load("Data/Images/mouse.png")

    
splashimg = Image.load("Data/Images/Intro/splash.png")
    
click1 = Image.load("Data/Images/Intro/Click1.png")
    
click2 = Image.load("Data/Images/Intro/Click2.png")

    
open1 = Image.load("Data/Images/Open.png")

    
background = Image.load("Data/Images/BG/background.png")
                
Folder1 = Image.load("Data/Images/Folder/folder1.png")
                
Folder2 = Image.load("Data/Images/Folder/folder2.png")

    
click = Sound.load("Data/Sounds/click.wav")

System.usbDiskModeActivate()

function
mouseControl()
      
pad = Controls.read()
      
dx = pad:analogX()
      if
math.abs(dx) > 32 then
         x0
= x0 + dx /(mousespeed)
      
end

      dy
= pad:analogY()
      if
math.abs(dy) > 32 then
         y0
= y0 + dy /(mousespeed)
      
end

      x1
= x0
      y1
= y0
      
if pad:start() then
         screen
.waitVblankStart(30)
         return
"menu"
      
end
end

--Option menu
function optionmenu()
oldoptionMenuPad = Controls.read()
loopoptionmenu = true
   
while loopoptionmenu do
      
screen:blit(0, 0, optionmenuimg,  false)

      
optionMenuPad = Controls.read()
      if
optionMenuPad ~= oldoptionMenuPad then
         
if optionMenuPad:cross() then
              screen
.waitVblankStart(10)
              
mainmenu()
              
loopoptionmenu = false
         end
      oldoptionMenuPad
= optionMenuPad
      end
      screen
:print(103, 240, "Press X to return to main menu.", red)
      
screen.waitVblankStart()
      
screen.flip()
   
end
end

--The Main Menu function
function
mainmenu()
oldmainMenuPad = Controls.read()
mainMenuSelection = 1
loopmainmenu
= true
while loopmainmenu do
      
screen:blit(0, 0, mainmenuimg,  false)
   if
mainMenuSelection == 1 then
      screen
:blit(120, 120, menupointerimg)
   elseif
mainMenuSelection == 2 then
      screen
:blit(120, 200, menupointerimg)
   
end

   screen
.waitVblankStart()
   
screen.flip()

   
mainMenuPad = Controls.read()
   if
mainMenuPad ~= oldmainMenuPad then
      
if mainMenuPad:down() then
         mainMenuSelection
= mainMenuSelection + 1
         click
:play()
         if
mainMenuSelection > 2 then
            mainMenuSelection
= 1
         end
      end
      
if mainMenuPad:up()then
         click
:play()
         
mainMenuSelection = mainMenuSelection - 1
         
if mainMenuSelection < 1 then
            mainMenuSelection
= 2
         end
      end
      
if mainMenuPad:cross() then
      click
:play()
         if
mainMenuSelection == 1 then
            getready
()
            
loopmainmenu = false
         
elseif mainMenuSelection == 2 then
            optionmenu
()
            
loopmainmenu = false
         end
      end
      oldmainMenuPad
= mainMenuPad
   end

   end
end



--Animations

function folder1()
      
screen:blit(0, 0, background, false)
      
screen:print(5, 5, string.format("PSP XMB V0.1"))
      
screen:print(350, 5, string.format("Time:".. time))
      
screen:blit(1, 1, folder1)
      
screen:blit(x1, y1, mouse)
      
screen:blit(x1 - 2, y1 - 2, open1)
      
screen.waitVblankStart()
end

mainmenu
()

while
true do
time = time - 1
      pad
= Controls.read()
      if
pad:select() then
         mainmenu
()
      
end
      
if targetControl() == "menu" then
         mainmenu
()
      
end
      
if didShotHit() == "hit" then
         click
:play()
         
open()
      
end
      
if didShotHit() == "headshot" then
         click
:play()
         
open()
      
end

      screen
:blit(0, 0, background, false)
      
screen:print(5, 5, string.format("PSP XMB V0.1"))
      
screen:print(350, 5, string.format("Time:".. time))
      
screen:blit(2, 2, Folder1)

      
end
      screen
:blit(x1, y1, mouse)
      
screen.waitVblankStart()
      
screen.flip()

      
end
end
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-20-2005, 05:39 PM   #2

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

very confusing
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-20-2005, 07:47 PM   #3
 
Join Date: Jul 2005
Location: In New York
Posts: 297
Trader Feedback: 0
Default

IVE CHOSEN HERE, MY 200th POST!!!! YEAH!!!!

Yeah dude, that looks a lil on the complicated side for a hello world.
ritterrav is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-20-2005, 09:22 PM   #4
 
indianajonesilm's Avatar
 
Join Date: Aug 2005
Posts: 26
Trader Feedback: 0
Default

Well one thing that is wrong is that you're attempting to call functions that don't exist in your script.
Code:
if targetControl() == "menu" then
     mainmenu()
end
if didShotHit() == "hit" then
Where are your targetControl, and didShotHit functions? Did you copy and paste from another script?
indianajonesilm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-21-2005, 06:08 AM   #5
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Quote:
Originally Posted by indianajonesilm
Well one thing that is wrong is that you're attempting to call functions that don't exist in your script.
Code:
if targetControl() == "menu" then
     mainmenu()
end
if didShotHit() == "hit" then
Where are your targetControl, and didShotHit functions? Did you copy and paste from another script?
Yeah i copied the main control's
But nothing else.
I Cant find i site thst has all the wright meaning's.
Is all i wanna create is a moving mouse.
and the app wont startup.
If anyone could modify my code i would be truley gratefull.
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-21-2005, 12:36 PM   #6

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

try something similar to this you can edit the sensitivity by fooling with the "/ 64" part


Code:
System.usbDiskModeActivate()
red = Color.new(255, 0, 0)
blue = Color.new(0, 0, 255)
black = Color.new(0, 0, 0)
white = Color.new(255, 255, 255)
green = Color.new(0, 255, 0)

cursor = Image.load("images/cursor.png")
background = Image.load("images/background2.png")
start = Image.load("images/start.png")
bar = Image.load("images/bar.png")
taskmanager = Image.load("images/taskmanager.png")

x0 = 0
y0 = 0
x1 = 0
y1 = 0


while true do
	screen:clear()
	screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
                    screen:blit(0, 242, start)
	screen:blit(100, 242, bar)
	screen:blit(370, 242, taskmanager)
	screen:print(200, 50, "By Slasher", white)
	
	pad = Controls.read()
	dx = pad:analogX()
	if math.abs(dx) > 32 then
		x0 = x0 + dx / 64
	end
	dy = pad:analogY()
	if math.abs(dy) > 32 then
		y0 = y0 + dy / 64
	end
	x1 = x0
	y1 = y0
			
	if pad:start() then
		break
	end
	if x0 < 0 then
		x0 = 0
	end
	if x0 > 470 then
		x0 = 470
	end
	if y0 < 0 then
		y0 = 0
	end
	if y0 > 258 then
		y0 = 258
	end

	screen:blit(x0, y0, cursor)
	screen.waitVblankStart()
	screen.flip()
end
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-21-2005, 01:43 PM   #7

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^
http://www.megaupload.com/?d=9VN8MM55

(that windows thing in a convenient package)
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-21-2005, 02:13 PM   #8
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Thank's Slasher!!!
That has really made this program usefull ALOT
So the only thing is now..
How can i get the mouse to click something and load a function??
Sorry but i need some serious lua coding help.
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-21-2005, 02:38 PM   #9

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

Yea...I was trying to figure that out but I can't seem to get it working I've got as far as clicking something then it pops out but once I stop holding down X it goes away i'm trying to get it to work if I do i'll let you know
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 10:27 AM   #10
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Quote:
Originally Posted by Slasher
Yea...I was trying to figure that out but I can't seem to get it working I've got as far as clicking something then it pops out but once I stop holding down X it goes away i'm trying to get it to work if I do i'll let you know
Ok i have done quite a good job so far.
But the drag button doesnt work.
I need a designer (If anyone want's to help Please PM me)
I Might be hosting it tomorrow.

P.S
Do i become a Premuin member if i make a new O.S in lua???
Just bored so i thought i may aswell ask.
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 12:42 PM   #11
 
gamesrus's Avatar
 
Join Date: Jun 2005
Location: My house
Posts: 384
Trader Feedback: 0
Default

P.S
Do i become a Premuin member if i make a new O.S in lua???
Just bored so i thought i may aswell ask.[/QUOTE]

yep. At least I think so. you are developing something so I dont see why not
gamesrus is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 12:55 PM   #12
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Quote:
Originally Posted by gamesrus
P.S
Do i become a Premuin member if i make a new O.S in lua???
Just bored so i thought i may aswell ask.
yep. At least I think so. you are developing something so I dont see why not[/QUOTE]
Do you have GTalk???
If so PM me you address and i will send you the beta.
Your a good and promising member so i think that i
can trust you.

P.S
It aint NOWHERE near finished yet so it might be abit crud lol.
But i wanted to create something that someone hasnt tried on lua.
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 01:50 PM   #13
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Here's the file
http://rapidshare.de/files/5413169/P..._V0.1.zip.html
It's a contribute to fluff's Psix.
And it's my first lua app YAY!!! lol :clap:
I Hope you all like becuase i aint coding this baby anymore.
It was just to get me started lol.
But hey dont worry becuase i am making some game's instead.
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 02:11 PM   #14
I think I ripped my pants
 
whitehawk's Avatar
 
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
Default

Quote:
Originally Posted by c5cha7
Here's the file
http://rapidshare.de/files/5413169/P..._V0.1.zip.html
It's a contribute to fluff's Psix.
And it's my first lua app YAY!!! lol :clap:
I Hope you all like becuase i aint coding this baby anymore.
It was just to get me started lol.
But hey dont worry becuase i am making some game's instead.
Haven't tested, but I'm looking forward to your games.

Oh and check the tutorials on luaplayer.org
whitehawk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 02:15 PM   #15

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

deleted

Last edited by Slasher; 11-07-2005 at 07:04 PM..
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-22-2005, 02:27 PM   #16
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

Quote:
Originally Posted by Slasher
Do you mind if I try and make this into something bigger and better?

PS- you will deffinately be getting the bulk of the credit
Take every bit of code you need..
I hace stopped working on it.
I Am now going onto bigger stuff like game's.
But i will code a new PSP XMB Soon enough :angel:
__________________
FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-23-2005, 12:38 PM   #17

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

nvm...im just gonna make my own and pwn yours
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
game or app , lua , player

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 07:11 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us