![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Links: PSProgramming , Lua Discussion Thread , PSP Dev Forum Rules , Lua Examples USE CODE TAGS! Hey guys, since ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 | ||
![]() NDS Mod
|
Links: PSProgramming, Lua Discussion Thread, PSP Dev Forum Rules, Lua Examples
USE CODE TAGS! Hey guys, since there are so many lua help threads popping up, we should just have one main one, so just post whatever lua questions you have in here. I'll start off ![]() when I use System.listDirectory() all I get are table values such as Quote:
Edit: Quote:
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] Last edited by Moose; 08-30-2008 at 08:07 AM.. |
||
|
|
|
|
|
#3 | |
![]() I think I ripped my pants
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
|
This is a good. Idea
You should sticky this (if you can, I know your a NDS mod ).If you can't, another mod should :icon_wink
__________________
![]() |
|
|
|
|
|
|
#4 | ||
![]() NDS Mod
|
Quote:
Quote:
Code:
print(tostring(System.powerGetBatteryLifePercent()) .. "%") screen:flip() while true do pad = Controls.read() if pad:cross() then break end end
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] Last edited by MagicianFB; 10-03-2005 at 03:52 PM.. |
||
|
|
|
|
|
#7 | |
![]() NDS Mod
|
Quote:
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
|
#10 | |
![]() NDS Mod
|
Quote:
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
|
#12 |
![]() ![]() Developer
|
Does anyone know how to make a sidescroller? do you need one giant image and use code to make it scroll once a unit enters a area. Does anyone have the code to do this or a example game in lua? Help would be apreciated.
22
__________________
![]() F.A.L.O?
|
|
|
|
|
|
#14 | ||
![]() I think I ripped my pants
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
|
Quote:
Code:
pad = Controls.read() if pad:square() and pad:circle() then break end
__________________
![]() |
||
|
|
|
|
|
#15 | |
![]() ![]() Rock Star
|
Quote:
__________________
![]() |
|
|
|
|
|
|
#16 | ||
![]() NDS Mod
|
Quote:
Quote:
both pad and Controls.read() only can have one value, so wouldn't this work better? Code:
while true do pad1 = Controls.read() pad2 = Controls.read() if pad1:square() then if pad2:circle() then break end end end
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] Last edited by MagicianFB; 10-03-2005 at 05:01 PM.. |
||
|
|
|
|
|
#19 |
![]() Advanced PSP Coder
|
I am trying to make a coin flipping program, you press X and it will display an message, heads, or with tails. Here is as far as the display part goes.
Code:
pad = Controls.read() screen:print(120, 15, "Welcome to my coin toss game!", blue) screen:print(60, 190, "Press X to Flip Coin!", yellow) screen.flip() if pad:cross() and (math.random(1,2) < 2) then while true do screen:clear() screen:blit(0, 0, bg, false) screen:print(120, 15, "Welcome to my coin toss game!", blue) screen:print(160, 30, "Created By Jesse", red) screen:print(60, 190, "Press X to Flip Coin!", yellow) screen.flip() screen:print(60, 160, "Coin Flipped! Heads!", yellow) while true do screen.flip() elseif pad:cross() and (math.random(1,2) > 1) then screen:clear() screen:blit(0, 0, bg, false) screen:print(120, 15, "Welcome to my coin toss game!", blue) screen:print(160, 30, "Created By Jesse", red) screen:print(60, 190, "Press X to Flip Coin!", yellow) screen.flip() screen:print(60,160, "Coin Flipped! Tails!", yellow) screen.flip() end[ |
|
|
|
|
|
#21 |
![]() ![]() Developer
|
this is probably n00bish but how do you load small images in certain spots?
Ive tried this: Random Image = Image.load(100, 200, "Random Image.png") but it wont load anything ( no that is not my real script just an example. I cant get anything to load it just says press start to restart. Every now and then text that is supposed to be displayed ends up showing in the menu. PLZ Help!
__________________
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude http://www.cools.biaklan.com Currently Working on ????? Quote of the Week |
|
|
|
|
|
#22 | ||
![]() NDS Mod
|
Quote:
Code:
image = Image.load("image.png")
screen:blit(=100, 200, image)
screen:flip()
Quote:
![]() Noone knows how to do what your asking.
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] Last edited by MagicianFB; 10-03-2005 at 07:24 PM.. |
||
|
|
|
|
|
#23 | |
![]() NDS Mod
|
Quote:
Code:
bg = Image.load("bg.png")
red = Color.new(255, 0, 0)
blue = Color.new(0, 0, 255)
yellow = Color.new(255, 255, 0)
while true do
pad = Controls.read()
screen:print(120, 15, "Welcome to my coin toss game!", blue)
screen:print(60, 190, "Press X to Flip Coin!", yellow)
screen.flip()
if pad:cross() then
side = math.random(2)
if side==1
screen:clear()
screen:blit(0, 0, bg, false)
screen:print(120, 15, "Welcome to my coin toss game!", blue)
screen:print(160, 30, "Created By Jesse", red)
screen:print(60, 190, "Press X to Flip Coin!", yellow)
screen:print(60, 160, "Coin Flipped! Heads!", yellow)
screen.flip()
elseif side==2
screen:clear()
screen:blit(0, 0, bg, false)
screen:print(120, 15, "Welcome to my coin toss game!", blue)
screen:print(160, 30, "Created By Jesse", red)
screen:print(60, 190, "Press X to Flip Coin!", yellow)
screen:print(60,160, "Coin Flipped! Tails!", yellow)
screen.flip()
end
end
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] Last edited by MagicianFB; 10-03-2005 at 07:41 PM.. |
|
|
|
|
|
|
#24 |
![]() Premium Member
|
Code:
pad = Controls.read() if pad:up() then menupos = menupos - 1 if menupos == 0 then menupos = 3 end end if pad:down() then menupos = menupos + 1 if menupos == 4 then menupos = 1 end end Edit: I tried Vblanks, but they didn't work at all. Code:
screen:print(0,40,"###",rgb) screen:print(0,50,"###",rgb) screen:print(0,60,"###",rgb) 3. It would be really cool if someone could show me some tips to optimize my code. Thanks in advance. Last edited by Lancer; 10-03-2005 at 10:47 PM.. |
|
|
|
|
|
#26 |
![]() ![]() Developer
|
Thanks !
__________________
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude http://www.cools.biaklan.com Currently Working on ????? Quote of the Week Last edited by cools; 10-06-2005 at 01:55 PM.. |
|
|
|
|
|
#28 |
|
11th Squad Captain
|
Oh YES!!!
I really need help (I never knew there was a thread like this) How can i make a main menu and make a topdown view person walk. I really wanna make my DBZ Charecter walk on the screen but he stay's still Anyhelp would be highley appreciated.
__________________
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! |
|
|
|
|
|
#29 | |
![]() NDS Mod
|
Quote:
Code:
function drawRect(where, x, y, width, height, color) where:drawLine(x, y, x+width, y, color) where:drawLine(x+width, y, x+width, y+height, color) where:drawLine(x+width, y+height, x, y+height, color) where:drawLine(x, y+height, x, y, color) end -- Use it like this drawRect(screen, 20, 20, 40, 20, blue) Just put this at the start of your while loop: Code:
screen.waitVblankStart(5)
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
|
#30 | |
![]() NDS Mod
|
Quote:
http://luaplayer.org/functions.txt
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
![]() |
| Tags |
| code , lib , lua , luaplayer , noobs , programming , psp programming , scripting , thread |
| Thread Tools | |
|
|