![]() |
| 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; Is there a more graceful way of doing this. Its looks very bad. edit: cool guys on channel #psplua on ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#181 | |
![]() ![]() Developer
|
Is there a more graceful way of doing this. Its looks very bad.
edit: cool guys on channel #psplua on irc helped me Quote:
__________________
![]() F.A.L.O?
Last edited by Twenty 2; 10-11-2005 at 04:40 PM.. |
|
|
|
|
|
|
#183 |
![]() ![]() Developer
|
pic loads, but when you press x nothing happens... Please help!
Code:
luas = Sound.load("comp.wav")
lua = Image.load("luasplash.png")
screen:blit(0, 0, lua, false)
screen.waitVblankStart()
screen.flip()
luas:play()
screen.waitVblankStart(240)
screen.flip()
Music.volume(255)
screen:clear()
monopoly = Image.load("monopolyboardnew.png")
screen:blit(0, 0, monopoly, false)
black = Color.new(0, 0, 0)
screen:print(85, 45, "Dice", black)
screen.flip()
while true do
screen.waitVblankStart()
pad = Controls.read()
dice1 = math.random(6)
dice2 = math.random(6)
if pad:cross() then
screen:print(80, 55,string.format("%d", dice1), black)
screen:print(100, 55,string.format("%d", dice2), black)
screen.flip()
screen.waitVblankStart(360)
end
__________________
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 |
|
|
|
|
|
#184 |
![]() |
I'm just guessing here, but first of all:
Code:
dice1 = math.random(6) dice2 = math.random(6) |
|
|
|
|
|
#185 |
![]() ![]() Developer
|
well it loaded, but it did not display the text over the picture. ( the pic takes up the whole screen...)
__________________
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 |
|
|
|
|
|
#186 | |
![]() |
Quote:
Code:
string.format("%d", dice1)
|
|
|
|
|
|
|
#187 |
![]() ![]() Developer
|
still it doesnt load...
that part of script/ Code:
dice = function()
dice1 = math.random(6)
dice2 = nath.random(6)
screen:print(80, 55,string.format("%02d", dice1), black)
screen:print(100, 55,string.format("%02d", dice2), black)
screen.flip()
screen.waitVblankStart(360)
end
if pad:cross() then
activate = function(dice)
end
end
__________________
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 |
|
|
|
|
|
#188 |
![]() |
What about this...
Code:
function rollDice()
dice1=math.random(1,6)
dice2=math.random(1,6)
end
--declare the funtion before the main loop
screen:print(80, 55,string.format("%02d", dice1), black)
screen:print(100, 55,string.format("%02d", dice2), black)
screen.flip()
screen.waitVblankStart(360)
end
if pad:cross() then rollDice() end
end
|
|
|
|
|
|
#189 |
![]() ![]() ...in a dream...
|
[QUOTE=SodR]Sry 2 post my question again but how do I get a text when I push a button to not disapear after I have released the button[QUOTE=SodR] dude i wudnt code if i were you i mean even with my limited comp use i still kno
screen.waitVblankStart(60 ) |
|
|
|
|
|
#190 | |
![]() |
[QUOTE=SG57][QUOTE=SodR]Sry 2 post my question again but how do I get a text when I push a button to not disapear after I have released the button
Quote:
. Everybody should have a chance to learn, dont let it get to ya SodR.
|
|
|
|
|
|
|
#191 |
![]() Premium Member
|
Okay, this one has had me stumped all day. I have been trying to get ball1 to bounce off of wall1 correctly. So far I have been able to get either the ball to react correctly to either the top and bottom or the left and right sides of the wall.
For example, I can get ball1 to bounce off the top and bottom of wall1 perfectly, but when it touches the sides it teleports the ball to the bottom of the wall. If I modify the code a little bit I can get the ball to bounce off the side, but it will also bounce up as if it had hit the floor, and the ball slides through the wall if it is forced into it. I am uploading a version from before I connected the collision detection because I figured the way I did it was unnecessarily complex, but the function I used is still in the code if you want to use it. I'd really appreciate it if someone could help me get past this roadblock. Thanks in advance. Edit: thanks to this kickass interactive tutorial, I managed to get things working. Last edited by Lancer; 10-20-2005 at 03:42 PM.. |
|
|
|
|
|
#192 |
![]() ![]() Developer
|
hey kinda new here but anyways i was wondering if someone could teach me how to do self animation control and if you dont understand i mean like be able to move text and the other buttons still work for the text even though it is moved i can upload my script if you want note i had some help and learned a lot and managed to get it running after some modifications to the script and its only a simple program and when i say simple i mean extremly so could someone help just ask and i will upload it to this post or a later post and thanks
__________________
1. Failed....again... 2. http://slicer.gibbocool.com/ stay updated on all my projects |
|
|
|
|
|
#193 |
![]() ![]() Developer
|
XteticX- Well i got it to work, but the numbers keep loading over themselves. so it looks crazy and is impossible to tell what number has shown up
Picture Animations........ well all u really have to do is... load an image... then use screen:clear() load the next image after the first. so Load an Image, Clear Screen, Load next image in sequence, Clear Screen... Do that as many times as needed. IT should look like a moving graphic. Note: I have never done this, but it should work...
__________________
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 |
|
|
|
|
|
#194 |
![]() NDS Mod
|
Wow... there sure are a lot of new lua threads...
BUMP
__________________
"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] |
|
|
|
|
|
#195 |
![]() ![]() ...in a dream...
|
how do u load a image if my cursor goes over a pixel
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#196 | |
![]() |
Quote:
Blank would be a transparent image And Item would be what you want to blit when the cursor is over the given pixel Code:
Blank=Image.load("blank.png")
Item=Image.load("item.png")
--Make it invisable at start up
IMAGE=Blank
Code:
if cursorX>=10 and cursorY>=10 then IMAGE=Item else IMAGE=Blank end screen:blit(10,10,IMAGE,true) Code:
if cursorX>=10 and cursorX<=30 and cursorY>=10 and cursorY<=30 then IMAGE=Item else IMAGE=Blank end screen:blit(10,10,IMAGE,true)
|
|
|
|
|
|
|
#197 | |
![]() Advanced PSP Coder
|
Quote:
__________________
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR] [B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B] [B]Applications: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b] [B]Games: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer] [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b] [img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center] |
|
|
|
|
|
|
#198 |
![]() ![]() ...in a dream...
|
i tried bliting the image stead of using else didnt work
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#200 |
![]() Advanced PSP Coder
|
I knew that
__________________
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR] [B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B] [B]Applications: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b] [B]Games: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer] [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b] [img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center] |
|
|
|
|
|
#201 |
![]() ![]() ...in a dream...
|
tht pixel thing aint working help plz
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#202 |
![]() Advanced PSP Coder
|
What exactly do you mean by load an image? You mean blit an image? Like if the cursor goes over something, then show a picture? Give me your code so far.
__________________
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR] [B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B] [B]Applications: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b] [B]Games: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer] [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b] [img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center] |
|
|
|
|
|
#203 |
![]() ![]() ...in a dream...
|
yes and i cant post code my comp broken
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#205 |
![]() Advanced PSP Coder
|
How is your computer broken yet you are posting this? What do you mean, "it's broken"?
__________________
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR] [B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B] [B]Applications: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b] [B]Games: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer] [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b] [img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center] |
|
|
|
|
|
#206 |
![]() |
Is there any possible way to "Resize" an image? Can anybody make a function for me? I want to take an Image (WITHOUT RESIZING IT WITH AN EDITOR) that has dimensions of 640x480, resize it to 272x480 (So it fits on the screen) and then blit it. Example:
Code:
Image1=Image.load("0001.png") --Image has dimensions 640x480
Image1:Resize(480, 272)
screen:blit(0, 0, Image1)
screen.flip()
Josh |
|
|
|
|
|
#207 |
![]() ![]() ...in a dream...
|
um im on fired up browser and i need more ram to get windows xp
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#208 | |
![]() Advanced PSP Coder
|
Quote:
I highly doubt this can be done, because Lua doesn't have this kinda stuff built into it, atleast not yet. But how hard is it to go into PS, and resize it t 480 x 272? I do it all the time.
__________________
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR] [B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B] [B]Applications: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b] [B]Games: [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer] [URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b] [img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center] |
|
|
|
|
|
|
#209 | |
![]() NDS Mod
|
Quote:
I'll try and find it.
__________________
"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] |
|
|
|
|
|
|
#210 |
![]() NDS Mod
|
Here it is:
http://forums.qj.net/191703-post9.html
__________________
"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 | |
|
|