![]() |
| 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; this question may sound dumb....I was loading a game i made, and i got an error stating: libpng: Not a ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#242 |
![]() ![]() ...in a dream...
|
specify if its .png or .PNG, ect.
__________________
...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) |
|
|
|
|
|
#244 |
![]() ![]() ...in a dream...
|
now bout the resizer function
__________________
...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) |
|
|
|
|
|
#246 |
![]() ![]() ...in a dream...
|
i dont have privelages too itsaid
__________________
...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) |
|
|
|
|
|
#247 |
![]() ![]() Developer
|
O well here it is:
smile = Image.load("smiley.png") function scaleImage(newX, newY, theImage) newImage = Image.createEmpty(newX, newY) for x = 1, newX do for y = 1, newY do newImage:blit(x,y , theImage, math.floor(x*(theImage:wi dth()/newX)),math.floor(y*(theI mage:height()/newY)), 1, 1) end end return newImage end --main program screen:blit(0, 0, smile) screen:blit(0, 100, scaleImage(200,100,smile) ) screen:blit(100, 0, scaleImage(20,100,smile)) screen:flip() screen.waitVblankStart(60 0)
__________________
![]() F.A.L.O?
|
|
|
|
|
|
#248 |
![]() ![]() ...in a dream...
|
thank you alot now ehn u said:
smile = Image.load("smiley.png") function scaleImage(newX, newY, theImage) newImage = Image.createEmpty(newX, newY) for x = 1, newX do for y = 1, newY do newImage:blit(x,y , theImage, math.floor(x*(theImage:wi dth()/newX)),math.floor(y*(theI mage:height()/newY)), 1, 1) end end return newImage end do i just put my picture instead of "smiley.png" and it should work or do i have to mod it abit so it fits my pictures dimensions and such also, am i basically defining the function then putting it in the loop or what cause im new to this "function" stuff for LUA everything else cool so basically, can u just tel me how i could put my picture in their instead of smiley so i can get the hang of this function thing? thx alot if u can ==edit== right now my dimensions of my picture are 400, 272 and where do iput the new dimensions? where you put the () after height and width next to newX and newY or what? sorry bout questions, just that ican make my game now that idont have to worry bout resizing if i can take ascreenshot when its resized lol and im done!
__________________
...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) Last edited by SG57; 11-05-2005 at 11:29 PM.. |
|
|
|
|
|
#249 |
![]() |
I have been working with a movement script for my game, analog doesn't move make my character move in all directions, only left, right, up and down. how do i make it so moves anyway i push that analog?
here is my coding: Code:
System.usbDiskModeActivate()
sprite = Image.load("jet2.png")
menubg = Image.load("menubg.png")
red = Color.new(255, 0, 0)
black = Color.new(0, 0, 0)
-- Players current X coord
pcXpos = 30
-- Players current Y coord
pcYpos = 115
-- Show the X/Y coords to adjust the movement #'s
screen:print(0, 0, tostring(pcXpos), red)
screen:print(0, 0, tostring(pcYpos), red)
function updateMove(xPos, yPos)
--{
analogPad = Controls.read()
dx = analogPad:analogX()
dy = analogPad:analogY()
-- Up
if dx > -60 and dx < 40 and dy == -128 or analogPad:up() then
pcYpos = pcYpos - 4
playerDirection = "up"
end
-- Left
if dy > -25 and dy < 40 and dx == -128 or analogPad:left() then
pcXpos = pcXpos - 4
playerDirection = "left"
end
-- Down
if dx > -40 and dx < 40 and dy == 127 or analogPad:down() then
pcYpos = pcYpos + 4
playerDirection = "down"
end
-- Right
if dy > -35 and dy < 45 and dx == 127 or analogPad:right() then
pcXpos = pcXpos + 4
playerDirection = "right"
end
-- Check to see if player is off screen
if pcXpos >= 431 then -- Subtract sprite width
pcXpos = 430
elseif pcXpos < 0 then
pcXpos = 00
end
if pcYpos >= 234 then -- Subtract sprite height
pcYpos = 232
elseif pcYpos < 0 then
pcYpos = 00
end
--}
end
while true do
screen:clear(black)
updateMove()
screen:blit(0, 0, menubg)
screen:blit(pcXpos, pcYpos, sprite)
pad = Controls.read()
if pad:start() then break end
screen.waitVblankStart()
screen.flip()
end
|
|
|
|
|
|
#250 |
![]() Advanced PSP Coder
|
Same way you are doing it, just add some more if's for other analog posistions..
__________________
[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] |
|
|
|
|
|
#251 | |
![]() |
Quote:
what if i wanted all way directional movement? would i have to keep adding if statements? Last edited by monster356; 11-06-2005 at 04:23 PM.. |
|
|
|
|
|
|
#257 |
![]() Advanced PSP Coder
|
For Monsters thing, you just blit an image a little bit to the right of the characters x posistion, and then add a x = x + 3 or something to the bullets x posistion, so it will increase and go to the right.
__________________
[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] |
|
|
|
|
|
#258 | |
![]() ![]() Developer
|
can someone help me it keeps saying its running the script but nuttin comes up
i am using lua the latest lua heres my code Quote:
__________________
1. Failed....again... 2. http://slicer.gibbocool.com/ stay updated on all my projects Last edited by slicer4ever; 11-08-2005 at 12:06 PM.. |
|
|
|
|
|
|
#259 | |
![]() |
Quote:
EDIT: this is my code: there is something wrong with it, when i press X it shows my missle like pratically offscreen, it just appears over there Code:
if pad:cross() then
bombX = pcXpos
bombY = pcYpos
while bombX < 480 do
screen:clear(black)
screen:blit(0, 0, menubg)
screen:blit(pcXpos, pcYpos, sprite)
screen:print(0, 20, tostring(dx), red) --analog coords
screen:print(20, 20, tostring(dy), red) --analog coords
screen:blit(bombX, bombY, missile)
bombX = bombX + 5 --Controls missile speed
end
end
Last edited by monster356; 11-08-2005 at 02:13 PM.. |
|
|
|
|
|
|
#260 | |
![]() 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] |
|
|
|
|
|
|
#261 |
![]() |
Ok i have a question. This code works perfectly fine but i dont know how to continue from this point onwards.
Pad buttons. How do i clear the buttons once they have been used so that the next time X is pressed, it will display a complete new line of text not "This Is The X Button And The Colour Used Is Green". Code:
System.usbDiskModeActivate() screen:clear() green = Color.new(0, 255, 0) red = Color.new(255, 0, 0) blue = Color.new(0, 0, 255) pink = Color.new(255, 20, 147) yellow = Color.new(255, 255, 0) A = "This Is The X Button And The Colour Used Is Green" B = "This Is The [] Button And The Colour Used Is Red" C = "This Is The O Button And The Colour Used Is Blue" D = "This Is The Button And The Colour Used Is Pink" E = "This Is The Start Button And X O [] Will Now Appear" while true do pad = Controls.read() pad2 = Controls.read() if pad:cross() then screen:clear() screen:print(10, 10, A, green) screen.flip() screen.waitVblankStart(60) screen:clear() screen.flip() end if pad:square() then screen:clear() screen:print(10, 20, B, red) screen.flip() screen.waitVblankStart(60) screen:clear() screen.flip() end if pad:circle() then screen:clear() screen:print(10, 30, C, blue) screen.flip() screen.waitVblankStart(60) screen:clear() screen.flip() end if pad:triangle() then screen:clear() screen:print(10, 40, D, pink) screen.flip() screen.waitVblankStart(60) screen:clear() screen.flip() end if pad:start() then screen:clear() screen:print(10, 50, E, yellow) screen.flip() screen.waitVblankStart(120) screen:print(10, 10, A, green) screen:print(10, 20, B, red) screen:print(10, 30, C, blue) screen:print(10, 40, D, pink) screen:print(10, 50, E, yellow) screen.flip() screen.waitVblankStart(500) screen:clear() screen.flip() end end |
|
|
|
|
|
#262 |
![]() ![]() Developer
|
You need to make a counting function so that every time you press x its the var + 1
so the var would be: count = 0 Then you would use: If pad:cross() then count=count+1 end And to display stuff to the screen you would put: If count==1 then screen rint(x, y, "whatever")elseif count==2 then screen rint(x, y, "more text here")end --and so on
__________________
![]() F.A.L.O?
|
|
|
|
|
|
#265 |
![]() Advanced PSP Coder
|
Yes ^
__________________
[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] |
|
|
|
|
|
#267 |
![]() Advanced PSP Coder
|
Not that I know of, no.
__________________
[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] |
|
|
|
|
|
#270 |
![]() ![]() Developer
|
virtue u said nvm to my post sorry for being gon for a day or 2 but what were you ganna say??? and if anyone wants to see my problem just go back a page thy
__________________
1. Failed....again... 2. http://slicer.gibbocool.com/ stay updated on all my projects |
|
|
|
![]() |
| Tags |
| code , lib , lua , luaplayer , noobs , programming , psp programming , scripting , thread |
| Thread Tools | |
|
|