Seite 50 von 342 ErsteErste ... 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 100 150 ... LetzteLetzte
Zeige Ergebnis 1.471 bis 1.500 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Why are you having the vertical value increase when you press right? You should be increasing the x value...

  
  1. #1471
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Why are you having the vertical value increase when you press right? You should be increasing the x value




  2. #1472
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    yea - but you can still use the letter y althugh it gets confusign, you just have to say (y, 100, ....)
    but i would use X

    TO - I really think people should use the devs one more, then we will be asking harder q's eh?
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  3. #1473
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Ya, but Im just saying its just easier to put (x, 25, ...) and then have x = x +5 when you press right


  4. #1474
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    ya I know, hey TO, what are you currently working on?
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  5. #1475
    Rock Star
    Points: 70.899, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    CT| FW: 4.01 M33-2
    Beiträge
    11.844
    Points
    70.899
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Check the sig....im about to get back to work on Tux Rampage, as I have a backup of that project, so I can continue where I left off


  6. #1476
    QJ Gamer Silver
    Points: 8.993, Level: 63
    Level completed: 81%, Points required for next Level: 57
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    England
    Beiträge
    1.038
    Points
    8.993
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard help

    could someone help me every time I load my lua thingy it gets to loading 90% but then my psp takes me back to eloader screen someone help me heres my code:

    Code:
    pink = Color.new(255, 0 , 153)
    blue = Color.new(0 , 153, 255)
    orange = Color.new(255, 102, 0)
    gray = Color.new(153, 153, 153)
    black = Color.new(0 , 0 , 0) 
    
    screen:print(194, 136, "Loading: 0%", pink)
    screen.flip()
    
    background = Image.load("images/background.jpg")
    
    screen:clear()
    screen:print(194, 136, "Loading: 20%", pink)
    screen.flip()
    
    circle = Image.load("images/buttons/circle_button.png")
    down = Image.load("images/buttons/down_arrow.png")
    
    screen:clear()
    screen:print(194, 136, "Loading: 40%", pink)
    screen.flip()
    
    l = Image.load("images/buttons/left_trigger.png")
    left = Image.load("images/buttons/left_arrow.png")
    
    screen:clear()
    screen:print(194, 136, "Loading: 60%", pink)
    screen.flip()
    
    r = Image.load("images/buttons/right_trigger.png")
    right = Image.load("images/buttons/right_arrow.png")
    boltsnd = Sound.load("music/comp.wav")
    
    screen:clear()
    screen:print(194, 136, "Loading: 80%", pink)
    screen.flip()
    
    square = Image.load("images/buttons/square_button.png")
    triangle = Image.load("images/buttons/triangle_button.png")
    
    screen:clear()
    screen:print(194, 136, "Loading: 90%", pink)
    screen.flip()
    
    up = Image.load("images/buttons/up_arrow.png")
    x = Image.load("images/buttons/cross_button.png")
    splash = Image.load("images/lua.gif")
    
    screen:clear()
    screen:print(194, 136, "Loading: 100%", pink)
    screen.flip()
    screen.waitVblankStart(60)
    
    screen:blit(0, 0, splash, false)
    screen.waitVblankStart()
    screen.flip() 
    
    boltsnd:play()
    screen.waitVblankStart(240)
    Music.volume(128)
    
    while true do
              screen:blit(0, 0, background, false)
    
    pad = Controls.read()
    
              screen:print(135, 251, "Press 'Start' to restart", blue)
              screen:print(110, 261, "Press 'Select' for a screenshot", blue)
              screen:print(383, 35, "Support:", black)
              screen:print(365, 45, "PS3Lounge.net", orange)
              screen:print(365, 55, "scriptscribbler.com/psp", gray)
              screen.flip()
    
    if pad:cross() then
                        screen:blit(50, 228, x)
                        screen.flip()
              end 
    
    if pad:circle() then
                        screen:blit(90, 195, circle)
                        screen.flip()
              end
    
              if pad:triangle() then
                        screen:blit(45, 165, triangle)
                        screen.flip()
              end
    
              if pad:square() then
                        screen:blit(15, 195, square)
                        screen.flip()
              end
    
              if pad:up() then
                        screen:blit(60, 40, up)
                        screen.flip()
              end
    
              if pad:right() then
                        screen:blit(90, 65, right)
                        screen.flip()
              end
    
              if pad:down() then
                        screen:blit(60, 80, down)
                        screen.flip()
              end
    
              if pad:left() then
                        screen:blit(30, 65, left)
                        screen.flip()
              end
    
              if pad:l() then
                        screen:blit(4, 6, l)
                        screen.flip()
              end
    
              if pad:r() then
                        screen:blit(403, 4, r)
                        screen.flip()
              end 
    
    if pad:select() then screen:save("screenshot.tga") end
    
             if pad:start() then
                        break
              end
    
    end
    I own a Playstation 3,PSP and a Wii add me on psn: azazin,

    Zitat Zitat von TheMasterChef
    Who gives a rat's ass about the size anyway?? It is not like you carry it around every day.

  7. #1477
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Try this:

    Code:
    pink = Color.new(255, 0 , 153)
    blue = Color.new(0 , 153, 255)
    orange = Color.new(255, 102, 0)
    gray = Color.new(153, 153, 153)
    black = Color.new(0 , 0 , 0) 
    
    background = Image.load("images/background.jpg")
    circle = Image.load("images/buttons/circle_button.png")
    down = Image.load("images/buttons/down_arrow.png")
    l = Image.load("images/buttons/left_trigger.png")
    left = Image.load("images/buttons/left_arrow.png")
    r = Image.load("images/buttons/right_trigger.png")
    right = Image.load("images/buttons/right_arrow.png")
    square = Image.load("images/buttons/square_button.png")
    triangle = Image.load("images/buttons/triangle_button.png")
    up = Image.load("images/buttons/up_arrow.png")
    x = Image.load("images/buttons/cross_button.png")
    splash = Image.load("images/lua.gif")
    
    boltsnd = Sound.load("music/comp.wav")
    
    
    screen:print(194, 136, "Loading: 0%", pink)
    screen.flip()
    
    
    
    screen:clear()
    screen:print(194, 136, "Loading: 20%", pink)
    screen.flip()
    
    
    screen:clear()
    screen:print(194, 136, "Loading: 40%", pink)
    screen.flip()
    
    
    screen:clear()
    screen:print(194, 136, "Loading: 60%", pink)
    screen.flip()
    
    
    
    screen:clear()
    screen:print(194, 136, "Loading: 80%", pink)
    screen.flip()
    
    screen:clear()
    screen:print(194, 136, "Loading: 90%", pink)
    screen.flip()
    
    
    screen:clear()
    screen:print(194, 136, "Loading: 100%", pink)
    screen.flip()
    screen.waitVblankStart(60  )
    
    screen:blit(0, 0, splash, false)
    screen.waitVblankStart()
    screen.flip() 
    
    boltsnd:play()
    screen.waitVblankStart(24  0)
    Music.volume(128)
    
    while true do
              screen:blit(0, 0, background, false)
    
    pad = Controls.read()
    
              screen:print(135, 251, "Press 'Start' to restart", blue)
              screen:print(110, 261, "Press 'Select' for a screenshot", blue)
              screen:print(383, 35, "Support:", black)
              screen:print(365, 45, "PS3Lounge.net", orange)
              screen:print(365, 55, "scriptscribbler.com/psp", gray)
              screen.flip()
    
    if pad:cross() then
                        screen:blit(50, 228, x)
                        screen.flip()
              end 
    
    if pad:circle() then
                        screen:blit(90, 195, circle)
                        screen.flip()
              end
    
              if pad:triangle() then
                        screen:blit(45, 165, triangle)
                        screen.flip()
              end
    
              if pad:square() then
                        screen:blit(15, 195, square)
                        screen.flip()
              end
    
              if pad:up() then
                        screen:blit(60, 40, up)
                        screen.flip()
              end
    
              if pad:right() then
                        screen:blit(90, 65, right)
                        screen.flip()
              end
    
              if pad:down() then
                        screen:blit(60, 80, down)
                        screen.flip()
              end
    
              if pad:left() then
                        screen:blit(30, 65, left)
                        screen.flip()
              end
    
              if pad:l() then
                        screen:blit(4, 6, l)
                        screen.flip()
              end
    
              if pad:r() then
                        screen:blit(403, 4, r)
                        screen.flip()
              end 
    
    if pad:select() then screen:save("screenshot.tga") end
    
             if pad:start() then
                        break
              end
    
    end


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  8. #1478
    QJ Gamer Bronze
    Points: 8.803, Level: 63
    Level completed: 18%, Points required for next Level: 247
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Western Australia
    Beiträge
    1.046
    Points
    8.803
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard

    How big can your .wav files be? Because I'm trying to use some for music but just by going songlay() (song is my song variable).

  9. #1479
    Mindless Fanboy
    Points: 17.218, Level: 83
    Level completed: 74%, Points required for next Level: 132
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.907
    Points
    17.218
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    i think they can be as big as you want them to be. try it. i am not too sure. if not, edit it down a bit

  10. #1480
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    I am so stuck on these tile backgrounds. Its really annoying me also.

    Code:
    --Load images
    tiles = Image.load("images/specialtiles.png")
    
    -- the map
    map1 = {
    	"dkkkkkkkkfaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"hlllllllleaaaaaaaacpaaaaa",
    	"aaaaaaaaaaaaaaaaaanoaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa"
    }
    
    function drawTile(tile, x, y)
    	local tileX = math.mod(tile, 4)
    	local tileY = math.floor(tile / 4)
    	screen:blit(16 * x, 16 * y, tiles, 17 * tileX + 1, 17 * tileY + 1, 16, 16, false)
    end
    
    while true do
    
    for y = 1, 17 do
    		line = map1[y]
    		for x = 1, 30 do
    			tile = string.byte(line, x) - string.byte("a")
    			drawTile(tile, x - 1, y - 1)
    		end
    	end
    
    screen.flip()
    end
    Error:

    error: game.lua:40: attempt to perform arithmetic on a nil value

    Please help!


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  11. #1481
    Think, Do, Gloat.
    Points: 12.687, Level: 73
    Level completed: 60%, Points required for next Level: 163
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    England, Norwich
    Beiträge
    1.422
    Points
    12.687
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Music files like wav's can't be that big. It is better to use MOD format or IT, or anything which uses modules, rather than a waveform. Also, loading times are affected if you try and load like 5 5mb song wavs.
    I would have thought though if you have to do it, maybe 2mb each. no longer than 30 seconds.

  12. #1482
    QJ Gamer Bronze
    Points: 5.459, Level: 47
    Level completed: 55%, Points required for next Level: 91
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Washington
    Beiträge
    211
    Points
    5.459
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TeamOverload
    Why are you having the vertical value increase when you press right? You should be increasing the x value

    Allright, changed it, but that didn't really change anything, the char image still does not move.


    white = Color.new(255, 255, 255)
    char = Image.load("char.png")
    x = 150

    screenrint(100, 100, "loading finished", white)
    screen.flip()
    screen.waitVblankStart(24 0)
    screen:clear()

    screen:blit(x, 50, char)
    screen.flip()

    pad = Controls.read()

    if pad:right() then
    x = x + 5
    end

    while true do
    screen.waitVblankStart()
    screen.flip()

    end
    Psp firmware: 1.5 - Thank you 0okm and Fanjita! ^^

  13. #1483
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    white = Color.new(255, 255, 255)
    char = Image.load("char.png")
    x = 150
    
    screenrint(100, 100, "loading finished", white)
    screen.flip()
    screen.waitVblankStart(24 0)
    screen:clear()
    
    screen:blit(x, 50, char)
    screen.flip()
    
    pad = Controls.read()
    
    if pad:right() then
    x = x + 5
    end
    
    while true do
    
    pad = Controls.read()
    screen:blit(x, 50, char)
    screen.flip()
    
    pad = Controls.read()
    
    if pad:right() then
    x = x + 5
    end
    screen.waitVblankStart()
    screen.flip()
    
    end
    Try that m8!


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  14. #1484
    QJ Gamer Bronze
    Points: 5.459, Level: 47
    Level completed: 55%, Points required for next Level: 91
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Washington
    Beiträge
    211
    Points
    5.459
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Ha, it works, thanks a ton!
    Psp firmware: 1.5 - Thank you 0okm and Fanjita! ^^

  15. #1485
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    @ct-boy

    If it stops at 90% it means there is something wrong between 90% and 100%. Just so you know for the future. I think people forget that, maybe im wrong. So anyway, Lua cant handle GIF's (yet), so change that in your code.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  16. #1486
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von kozine
    I am so stuck on these tile backgrounds. Its really annoying me also.

    Code:
    --Load images
    tiles = Image.load("images/specialtiles.png")
    
    -- the map
    map1 = {
    	"dkkkkkkkkfaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"ibgbgbbgbjaaaaaaaaaaaaaaa",
    	"hlllllllleaaaaaaaacpaaaaa",
    	"aaaaaaaaaaaaaaaaaanoaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa",
    	"aaaaaaaaaaaaaaaaaaaaaaaaa"
    }
    
    function drawTile(tile, x, y)
    	local tileX = math.mod(tile, 4)
    	local tileY = math.floor(tile / 4)
    	screen:blit(16 * x, 16 * y, tiles, 17 * tileX + 1, 17 * tileY + 1, 16, 16, false)
    end
    
    while true do
    
    for y = 1, 17 do
    		line = map1[y]
    		for x = 1, 30 do
    			tile = string.byte(line, x) - string.byte("a")
    			drawTile(tile, x - 1, y - 1)
    		end
    	end
    
    screen.flip()
    end
    Error:

    error: game.lua:40: attempt to perform arithmetic on a nil value

    Please help!
    Cant help you if you dont tell me/us what line line 40 is :P . But anyway, the error means that something gets compared to something that hasnt got any value, so just check all the previous statements where that variable is involved in. Hope that its clear, otherwise you need to tell which line it is.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  17. #1487
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    NVM it fixed. I had less tiles.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  18. #1488
    QJ Gamer Silver
    Points: 7.109, Level: 55
    Level completed: 80%, Points required for next Level: 41
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Puerto Rico
    Beiträge
    310
    Points
    7.109
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von kozine
    Ok try this:

    Code:
    --Load images
    pica = Image.load("Path to image")
    picb = Image.load("Path to image")
    
    --Begin the main loop
    while true do
    pad = Controls.read()
    
    screen:blit(0, 0, pica)
    
    if pad:cross() then
    screen:blit(0, 0, picb)
    end
    
    screen.flip()
    end
    That works for me!
    It didn't work the way I wanted it too. I'm tring to make a pinball game and I want the flappers to move



    With the code you gave me it overlaps on one another. Give it a try. I need that when one pic appears another disappears and viceversa. I would like the help. Thanks.

  19. #1489
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    I dont think u replaces the 0's with the place u wanted it?


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  20. #1490
    QJ Gamer Silver
    Points: 7.109, Level: 55
    Level completed: 80%, Points required for next Level: 41
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Puerto Rico
    Beiträge
    310
    Points
    7.109
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Yes I've changed the 0's but that does not change the overlapping.

  21. #1491
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    --Load images
    pica = Image.load("Path to image")
    picb = Image.load("Path to image")

    --Begin the main loop
    while true do
    pad = Controls.read()

    screen:blit(0, 0, pica)

    if pad:cross() then
    screen:clear()
    screen:blit(0, 0, picb)
    end

    screen.flip()
    end


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  22. #1492
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    This works:

    Code:
    --Load images
    bg = Image.load("bg.png")
    pic = {}
    pic[1] = Image.load("flapperleft1.png")
    pic[2] = Image.load("flapperleft2.png")
    imgpic=pic[1]
    
    --Begin the main loop
    while true do
    screen:blit(0, 0, bg)
    pad = Controls.read()
    
    if pad:cross() then
    imgpic=pic[2]
    else
    imgpic=pic[1]
    end
    
    screen:blit(0, 0, imgpic)
    screen.flip()
    end
    Try it !
    Also BG is the background, as i thought it would look neat...
    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!

  23. #1493
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Is there ANYBODY on this site that can help me make a two picture animation? at all?
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  24. #1494
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Explain EXACTLY what you would like to do Greenskull.
    D:

  25. #1495
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    when you press X, I want a dude to talk using two pictures, I want him to keep talking untill I press X again.
    Games I Made:
    Stick Dance
    Stick Dance V2
    50% Done "Smile Quartet"


    MY XBOX.COM GAMER SPOTLIGHT!

  26. #1496
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Something like(untested, just typed it up here):

    Code:
    frame1 = Image.load("bla.png")
    frame2 = Image.load("bla2.png")
    
    Animation = 0
    
    while true do
    
    pad = Controls.read()
    
    if Animation = 0 then
    screen:blit(x,y,frame1)
    screen.flip()
    screen.waitVblankStart()
    end
    
    if Animation = 1 then
    screen:blit(x,y,frame1)
    screen.flip()
    screen.waitVblankStart(change depending on the delay needed)
    screen:clear()
    screen:blit(x,y,frame2)
    screen.flip()
    screen.waitVblankStart(again change for delay)
    screen:clear()
    end
    
    if pad:cross() and Animation == 0 then
    Animation = 1
    end
    
    if pad:cross() and Animation == 1 then
    Animation = 0
    end
    end
    I dunno if this works, as i say i just typed it up, but it should be along the lines of what you need.
    D:

  27. #1497
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    As others have explained to you how animation works im not explaining that. To make the animation go untill you press X again just use a variable:
    Code:
    if pressed==true
    play animantion
    end
    
    if pad:cross() and pressed==true then
    pressed=false
    end
    easy as that...
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  28. #1498
    Developer
    Points: 6.074, Level: 50
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    270
    Points
    6.074
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I don't get why this doesn't work. I keep getting the "attempt to index field '?' ( a nil value)" error.

    Code:
    for i = 1,21 do
    something[i] = {x = 25 + 10 * i, y = 480 - picture1:height(), pic = picture1}
    end
    while true do
    screen:blit(something[i].x, something[i].y, something[i].pic)
    end
    please don't just tell me what's wrong, also tell me how to fix it. Thanks

  29. #1499
    Points: 4.063, Level: 40
    Level completed: 57%, Points required for next Level: 87
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    7
    Points
    4.063
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    You have to initiate something:

    Code:
    something = {}
    for i = 1,21 do
    something[i] = {x = 25 + 10 * i, y = 480 - picture1:height(), pic = picture1}
    end
    while true do
    screen:blit(something[i].x, something[i].y, something[i].pic)
    end

  30. #1500
    Developer
    Points: 6.074, Level: 50
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    270
    Points
    6.074
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    How do I make a function run only once? (while in the "While true do" loop)

    Also, when I want make a function to print a random number between say, 1 and 30, it prints all of them! How do I make it print just one? ( or maybe, assign just one number between 1 and 30 to a variable...I have the problem that if a = math.random(1,30), a = 1 through 30)
    Geändert von ro0kie42 (04-12-2006 um 10:43 PM Uhr)


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 08:58 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .