It means that the method you called should use a colon instead of a dot. For instance:Zitat:
Zitat von montrob
as opposed toCode:screen:print(x, y, string, color)
Code:screen.print(x, y, string, color)
Printable View
It means that the method you called should use a colon instead of a dot. For instance:Zitat:
Zitat von montrob
as opposed toCode:screen:print(x, y, string, color)
Code:screen.print(x, y, string, color)
guys whats wrong with this ???
is this supposed to work?? I looked at a sourceCode:tittle = Image.load("title.png")
while true do
screen:clear()
pad = Controls.read()
screen:blit(0,0, tittle)
if pad:start() then playergame1() end
if pad:select() then
break
end
screen.flip()
screen.waitVblankStart()
end
arrow = Image.load("arrow2.png")
blank = Image.load("blank.png")
letterPos = {}
letterPosx = 200
letterPosy = 150
function playergame1()
while true do
screen:clear()
pad = Controls.read()
screen:blit(letterPosx,letterPosy, arrow)
screen:blit(0,0, blank)
if pad:select() then
break
end
screen.flip()
screen.waitVblankStart()
end
end
I think i put the function or the pad start function wrong. can someone correct me pls
~EDIT~ aaa never mind, i just changed the 1st background to be last and it worked :icon_bigg
anyways , can someone tell how to make a moving arrow to not bypass the screen?
? Moving arrow to not bypass the screen?
If you mean boundaries, then there simple.
There are multiple ways to do this. I just gave a quikc wexmaple to help u. (Since well, trying to contribute to the scene as much as i can since once Sony has all the next big things out for the firmware, im upgrading :-( } Now, all you really have to change to use this for your own is replace the CursorsDimensionX wth your cursors X dimension (width), replace the CursorsDimensionY with your cursors Y dimension (height). Along with what your image of the cursor is actually called, where to load it from, etc. You may also manipulate the CursorMovementSpeed integer to your liking since that is how 'sensitive' your cursor will be. 5 is a decent value. You may also in later games or something, instead of a cursor, replace it with a rock or a shot, and have instaed of it stopping aafter offsecreen, but have it return back to the opposite side of what screen it is on to have it keep playing.Code:Cursor = Image.load("cursor.png")
CursorX=240
CursorY = 136
CursorMovementSpeed = 5
CursorsDimensionY = 0 --for this ex
CursorsDimensionX = 0 --for this ex
while true do
input = Controls.read()
blit:Cursor(blit the Cursor image to (CursorX, CursorY)with dimensions (CursorsDimensionX, CursorsDimensionY))
if input:up() then CursorY = CursorY - CursorMovementSpeed
else if input:down() then CursorY = CursorY + CursorMovementSpeed
else if input:left() then CursorX = CursorX - CursorMovementSpeed
else if input:right() then CursorX = CursorX + CursorMovementSpeed
else if CursorY<0 then CursorY = 0
else if CursorY>272-CursorsDeimensionY then CursorY = 272-CursorsDeimensionY
else if CursorX<0 then CursorX = 0
else if CursorX>480-CursorsDimensionX then 480-CursorsDimensionX
end
end
Just a quick newbies help tut there.
:humped: I couldnt make it too advanced. Or else it would confuse new people. But seriously, you/I can make 'some serious stuff happen if you know what your doing :Punk:Zitat:
Zitat von Sousanator
P.S. 4 more days of finals left! w00t w00t, then i can start coding again to finish some of my projects up.
thx.... when i get back from school and i understand it and how it works, my portable paint is almost ready for its 1st verson
:icon_smil
guys what is the code that if i press start, it will reset the function ? so it starts all over again with a new blank background if it have something before
uhh... a paint program probably meaning you 'created' a blank image with its dimensions, so just use a clear image type prototype and insert your image there.
but if your wondering for resseting a function, I thionkyou mean like running it again, which you just call, if pad:start() then reset_function_goes_here( ) end
hey SG57, this is oftopic, but are u still workin on that kitten cannon game?Zitat:
Zitat von SG57
SG57 are you sure thats the right formula ?
becuase it gives me error though
the reset and the function dint work with me but i tryed a thing that workedZitat:
Zitat von SG57
put canvas = Image.load("blank.png")
screen:clear()
before while true do and then
if pad:start() then [Function()] end
I looked at some threads about if there is a way to make lua into an eboot but got confused. one sais that lua can be into a eboot and anothe guy said it cant
Is it possible or no ?
if it is . can you help me ?