my break command works fine on windows, but not in PSP.
??? :icon_sad:
Printable View
my break command works fine on windows, but not in PSP.
??? :icon_sad:
no worries altair, luckily, i just worked around the error. copied and pasted the stuff i had done into an older version of the app, so it works just fine! only took like 3 mins in the end.
i'll have to keep thinking on it i think. i will try out some sounds in lua and see they lose quality if i hold them down.
if you find it out, please tell me, since i have the same problem
Well. I'm preaty new to lua but have teh basics down. I want to make an rpg of some sort and right now I am trying to figure out how I would make the world (background?) from a tile sheet. I've seen some people do it that way so I figure its the best.
I have looked at a bunch of tuorials and came across: "http://wiki.ps2dev.org/psp:lua_player:tutorial" Which at the bottom tells me about tiles and how to use them.
now, I don't really get what is going on in the script. I could copy and past it and just use it but I would REALLY apriciate it if someone could tell me what each part means like:
"screen:blit(16 * x, 16 * y, tiles, 17 * tileX + 1, 17 * tileY + 1, 16, 16, false)"
screen:blit = prints picture to screen
16 * x = first cordinate of something something -- 16 = number of pixels of "image.png", *=multiply, x = bla bla bla...
or something like that. I dont know what Im talking about in the example but I hope you get what I mean. Thanks!
P.S. If this has been answered then Im really sorry. Its just that 103 pages is alot!
basically it's dynamically setting up the image locations and where they will appear on the screen..
imagine your PSP screen is like a cartoon animation.. you have different layers.. for example your background, main character, foreground, etc..
They all stack on top of each other in the order that you draw them.. so first things first you want to draw your background... in your case you will be using tiles to create the background.
A table is created to store the information for the background and where to draw each tile. A function would then read the information from the table and get the variables which tell lua where to put the image.
You should copy the tutorial script and images and get it working yourself. Once you have a working version of the tutorial, you can modify it by substituting your own images and adjusting the values to get it to work for your application. This will help you learn the small fine-tuning skills you will need to develop a bug-free application.
Hope I've helped answer your question and good luck!
I'm trying to blit a random image, i'm using this:
and my array looks like this:Code:screen:blit(enemy.x,enemy.y,enemysprite[math.random(1,2)])
But i get this error:Code:enemysprite = {}
enemysprite.a = Image.load("Images/enemy1.png")
enemysprite.b = Image.load("Images/enemy2.png")
Can you not blit from an array?Code:error: Jumper.lua:93: bad argument #2 to `blit' (Image expected, got nil)
Is there another way to do this?
hmm i think you can, but you can always just use variables. And say if var==1 then image1 end etc. But using a table would be more convenient ofcourse.
BTW what is the line where the error occurs?
The error occours on the blit.
Ok i got it: You haven't got it stored in enemysprite[number] but in enemysprite.a en .b which will never be generated by math.random obviously.
So what you should do is:
Code:enemysprite = {Image.load("Images/enemy1.png"),Image.load("Images/enemy2.png")}