Seite 264 von 342 ErsteErste ... 164 214 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 314 ... LetzteLetzte
Zeige Ergebnis 7.891 bis 7.920 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; Post that part of code please. You need to input a "then" by a "="...

  
  1. #7891
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Post that part of code please.
    You need to input a "then" by a "="



  2. #7892
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)

    menustatus = 1

    while true do
    screen:clear(black)
    pad = Controls.read()

    if pad:up() then
    menustatus = menustatus - 1
    screen.waitVblankStart(4)
    end

    if pad:down() then
    menustatus = menustatus + 1
    screen.waitVblankStart(4)
    end

    color={white, white, white, white}

    screenrint(50,50,"Road To St. Louis", color[1])
    screenrint(50,60,"Exhibition", color[2])
    screenrint(50,70,"Options", color[3])
    screenrint(50,80,"Exit", color[4])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() then
    --insert game code here
    end
    end

    if menustatus == 2 then
    if pad:cross() then
    --insert Exhibition here
    end
    end

    if menustatus == 3 then
    -- inserts options here
    }

    while true do
    if up1() and then cursor=cursor-1 end
    if down1() and then cursor=cursor+1 end

    if cursor==0 then cursor=2 end
    if cursor==3 then cursor=1 end

    screen:clear(black)
    list_options(8,8,options, ">",1,white,red,curso r)
    screen:flip()

    if cross1() or circle1() then
    if cursor==1 then
    --Insert Code Here
    elseif cursor==2 then
    --Insert Code Here
    elseif cursor==3 then
    --Insert Code Here
    elseif cursor==4 then
    --Insert Code Here
    elseif cursor==5 then
    --Insert Code Here
    end
    end

    if menustatus == 4 then
    if pad:cross() then
    break
    end
    end

    if menustatus <= 0 then
    menustatus = 4
    end

    if menustatus => 5 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    end
    -= Double Post =-
    Opps I forgot to remove some of the Ends to show what the file was like before, ill look at it soon.
    -= Double Post =-
    Fixed
    Geändert von SportzOwner (08-11-2007 um 11:18 PM Uhr) Grund: Automerged Doublepost

  3. #7893
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Um im trying to fix your code via formatting, yet I can't work anything out... Example - why the hell is there a random '}' in the middle there?

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  4. #7894
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Dont you need the options?

    Code:
    options = {
       "Option 1",
       "Option 2"
     }
    -= Double Post =-
    Now that I look at it, Your combining that Menu Status snippet with the list_options example.
    Geändert von Anti-QuickJay (08-12-2007 um 12:25 AM Uhr) Grund: Automerged Doublepost

  5. #7895
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Opps i think thats suppose to be a end end there, i had another code in there, but removed it to show what it was like, that explains my newest error. :), i didn't look hard enough and it was 2 am.
    -= Double Post =-
    Opps i still had some of the extra code in there. From the options, and i removed half of it in the last code heres what it suppose to be.

    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)

    menustatus = 1

    while true do
    screen:clear(black)
    pad = Controls.read()

    if pad:up() then
    menustatus = menustatus - 1
    screen.waitVblankStart(4)
    end

    if pad:down() then
    menustatus = menustatus + 1
    screen.waitVblankStart(4)
    end

    color={white, white, white, white}

    screenrint(50,50,"Road To St. Louis", color[1])
    screenrint(50,60,"Exhibition", color[2])
    screenrint(50,70,"Options", color[3])
    screenrint(50,80,"Exit", color[4])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() then
    --insert game code here
    end
    end

    if menustatus == 2 then
    if pad:cross() then
    --insert Exhibition here
    end
    end

    if menustatus == 3 then
    -- inserts options here
    end
    end

    if menustatus == 4 then
    if pad:cross() then
    break
    end
    end

    if menustatus <= 0 then
    menustatus = 4
    end

    if menustatus => 5 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    end
    -= Double Post =-
    Okay I think i fixed the error, its now on line 50, no loop near break on the above code

    Line 50 area, i know it saying it can't break
    if menustatus == 4 then
    if pad:cross() then
    break
    end
    end
    Geändert von SportzOwner (08-12-2007 um 12:16 PM Uhr) Grund: Automerged Doublepost

  6. #7896
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Remove the break and put something like System.Quit() or os.exit

  7. #7897
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    if menustatus == 3 then
    -- inserts options here
    end
    end
    remove 1 end

  8. #7898
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    1 end from all menu status?

    and yes these are from the snippits, im trying them out, and i did have the options in it untill i moved it.
    -= Double Post =-
    Opps i left out the pad:cross out of the options

    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)

    menustatus = 1

    while true do
    screen:clear(black)
    pad = Controls.read()

    if pad:up() then
    menustatus = menustatus - 1
    screen.waitVblankStart(4)
    end

    if pad:down() then
    menustatus = menustatus + 1
    screen.waitVblankStart(4)
    end

    color={white, white, white, white}

    screenrint(50,50,"Road To St. Louis", color[1])
    screenrint(50,60,"Exhibition", color[2])
    screenrint(50,70,"Options", color[3])
    screenrint(50,80,"Exit", color[4])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() then
    --insert game code here
    end
    end

    if menustatus == 2 then
    if pad:cross() then
    --insert Exhibition here
    end
    end

    if menustatus == 3 then
    if pad:cross() then
    -- inserts options here
    end
    end

    if menustatus == 4 then
    if pad:cross() then
    System.Quit()
    end
    end

    if menustatus <= 0 then
    menustatus = 4
    end

    if menustatus => 5 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    end
    Now it should be right.
    Geändert von SportzOwner (08-12-2007 um 01:08 PM Uhr) Grund: Automerged Doublepost

  9. #7899
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Remove the

    Code:
    screen.waitVblankStart(4)
    and add a
    Code:
    oldpad = pad
    behind the last vblank at the end of your code.

  10. #7900
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Okay so we ended with
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)

    menustatus = 1

    while true do
    screen:clear(black)
    pad = Controls.read()

    if pad:up() then
    menustatus = menustatus - 1
    end

    if pad:down() then
    menustatus = menustatus + 1
    end

    color={white, white, white, white}

    screen:print(50,50,"Road To St. Louis", color[1])
    screen:print(50,60,"Exhib ition", color[2])
    screen:print(50,70,"Optio ns", color[3])
    screen:print(50,80,"Exit" , color[4])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() then
    --insert game code here
    end
    end

    if menustatus == 2 then
    if pad:cross() then
    --insert Exhibition here
    end
    end

    if menustatus == 3 then
    if pad:cross() then
    -- inserts options here
    end
    end

    if menustatus == 4 then
    if pad:cross() then
    System.Quit()
    end
    end

    if menustatus <= 0 then
    menustatus = 4
    end

    if menustatus => 5 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    oldpad = pad
    end
    Ill go test it.
    -= Double Post =-
    oldpad = pad
    That gave off another then expected near = error as that is line 56
    Geändert von SportzOwner (08-12-2007 um 01:59 PM Uhr) Grund: Automerged Doublepost

  11. #7901
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    if you are using the oldpad technique, then in each keypress if statement you need to do something like:
    Code:
    if pad:up() and oldpad:up() ~= pad:up() then ...
    as for that error it spat out at you i'm not sure why that shouldn't have worked. try putting at the top of your code somewhere:
    Code:
    oldpad = Controls.read()
    i'm not sure if that will fix it or not, i'll do some tests to see if it will real quick though
    -= Double Post =-
    ok after thinking about it, i'm not sure why that [then expected near "="] error came up, you would still need that oldpad = Controls.read() at the top of your code somewhere so that it is declared as a controls.read() variable before it is used. otherwise, on the first loop through it wouldn't even be a variable yet.
    Geändert von emericaska8r (08-12-2007 um 07:15 PM Uhr) Grund: Automerged Doublepost

  12. #7902
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Same error, just now its on line 70 because of extra coding put in.

    pad = Controls.read()
    oldpad = pad

    currstate="startup"
    function printCentered(y, text, color)
    local tl=string.len(text)
    local xmod = 240-((tl*10)/2)
    screen:print(xmod, y, text, color)
    end
    -----------------
    dofile("colors.lua")--contains all color codes, make one yourself
    -----------------
    screen:clear()
    printCentered(131,"Starti ng up...",white)
    screen.waitVblankStart(3)
    screen.flip()
    -----------------------------------------
    function mainmenu()
    menustatus = 1

    while true do
    screen:clear(black)


    if pad:up() and oldpad:up() ~= pad:up() then
    menustatus = menustatus - 1
    end

    if pad:down() and oldpad:down() ~= pad:down() then
    menustatus = menustatus + 1
    end

    color={white, white, white, white}

    screen:print(50,50,"Road To St. Louis", color[1])
    screen:print(50,60,"Exhib ition", color[2])
    screen:print(50,70,"Optio ns", color[3])
    screen:print(50,80,"Exit" , color[4])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() and oldpad:cross() ~= pad:cross() then
    --insert game code here
    end
    end

    if menustatus == 2 then
    if pad:cross() and oldpad:cross() ~= pad:cross() then
    --insert Exhibition here
    end
    end

    if menustatus == 3 then
    if pad:cross() and oldpad:cross() ~= pad:cross() then
    -- inserts options here
    end
    end

    if menustatus == 4 then
    if pad:cross() and oldpad:cross() ~= pad:cross() then
    System.Quit()
    end
    end

    if menustatus <= 0 then
    menustatus = 4
    end

    if menustatus => 5 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    end
    end

    ---------------------------
    screen:clear()
    printCentered(131,"Press Start",white)
    screen.waitVblankStart()
    screen.flip()
    if pad:start() and oldpad:start() ~= pad:start() then
    currstate="menu"
    end
    end
    ----------------------------

    if currstate = "menu" then
    menu()
    end
    end

  13. #7903
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    ok. that all worked, and i found out that your error was that you put
    Code:
    if menustatus => 5 then
    that needed to be ">=" ... here is a revised code of it all
    Code:
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)
    
    menustatus = 1
    
    oldpad = Controls.read()
    
    while true do
      screen:clear(black)
      pad = Controls.read()
    
      if pad:up() and oldpad:up() ~= pad:up() then
        menustatus = menustatus - 1
      end
    
      if pad:down() and oldpad:down() ~= pad:down() then
        menustatus = menustatus + 1
      end
    
      color={white, white, white, white}
    
      screen:print(50,50,"Road To St. Louis", color[1])
      screen:print(50,60,"Exhib ition", color[2])
      screen:print(50,70,"Optio ns", color[3])
      screen:print(50,80,"Exit" , color[4])
    
      color[menustatus]=red
    
      if menustatus == 1 then
        if pad:cross() then
          --insert game code here
        end
      end
    
      if menustatus == 2 then
        if pad:cross() then
          --insert Exhibition here
        end
      end
    
      if menustatus == 3 then
        if pad:cross() then
          -- inserts options here
        end
      end
    
      if menustatus == 4 then
        if pad:cross() then
          System.Quit()
        end
      end
    
      if menustatus <= 0 then
        menustatus = 4
      end
    
      if menustatus >= 5 then
        menustatus = 1
      end
    
      screen.flip()
      screen.waitVblankStart()
      oldpad = pad
    end

  14. #7904
    QJ Gamer Blue
    Points: 7.014, Level: 55
    Level completed: 32%, Points required for next Level: 136
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    U.S.
    Beiträge
    405
    Points
    7.014
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    I use "if pad:cross() and not oldpad:cross()"

    Less words, works perfectly.

  15. #7905
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    I put oldpad because somone told me to, earlier, ill test it without it later.

  16. #7906
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Less words? This less words regardless of the number of buttons wanted:
    Code:
    if oldpad ~= pad then
        if pad:cross() then
            -- X pressed once
        end
    end

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  17. #7907
    QJ Gamer Silver
    Points: 6.948, Level: 54
    Level completed: 99%, Points required for next Level: 2
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    657
    Points
    6.948
    Level
    54
    Downloads
    5
    Uploads
    0

    Standard

    How would you properly:

    Look for a file on memory stick, and do "Action A" If it exists, or do "Action B" if it does not?

  18. #7908
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    file = io.open(ms0:/path)

    if file then
    -- action a
    file:close()
    else
    -- action b
    end

  19. #7909
    QJ Gamer Silver
    Points: 6.948, Level: 54
    Level completed: 99%, Points required for next Level: 2
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    657
    Points
    6.948
    Level
    54
    Downloads
    5
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    file = io.open(ms0:/path)

    if file then
    -- action a
    file:close()
    else
    -- action b
    end

    Cool. Thanks man, turns out i left something out of the file path, and thats why it wasn't working. :P


    Thanks for the reply. :)
    Geändert von Mr_Shizzy (08-13-2007 um 08:51 AM Uhr)

  20. #7910
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Gah now i can't this to leave my image sportz.jpg, any help?

    black = Color.new(0,0,0)
    pad = Controls.read()
    white = Color.new(255,255,255)
    --------------
    function printCentered(y,text,colo r)
    local length = string.len(text)
    local x = 240 - ((length*8)/2)
    screen:print(x,y,text,col or)
    end
    --------------
    function scaleImage(newX, newY, theImage)

    resizedImage = Image.createEmpty(newX, newY)
    for x = 1, newX do
    for y = 1, newY do
    resizedImage:blit(x,y , theImage,
    math.floor(x*(theImage:wi dth()/newX)),
    math.floor(y*(theImage:he ight()/newY)),1,1)
    end
    end
    return resizedImage
    end
    --------------
    screen:clear(black)
    printCentered(131,"Starti ng up...",white)
    screen.waitVblankStart(3)
    screen.flip()
    --------------
    sportz = Image.load("sportz.jpg")
    -------------

    scaleImage(480,272, sportz) -- Resize image.

    while true do
    screen:blit(0,0, resizedImage) -- Show the resized image

    screen.waitVblankStart(3)
    screen.flip()
    currstate="ready"
    end
    --------------
    pad=Controls.read()
    screen:clear(black)
    if currstate=="ready" then

    screen:clear()
    printCentered(100,"Press Start",white)
    printCentered(300,"Powere d by Sportz",white)
    screen.waitVblankStart()
    screen.flip()
    if pad:start() then
    dofile("menu.lua")
    end
    end

  21. #7911
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    leave my image sportz.jpg
    English please? I don't understand what that means.

  22. #7912
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    with this code here:
    Code:
    scaleImage(480,272, sportz) -- Resize image.
    i beleive you have to do :
    Code:
    somevariable = scaleImage(480,272, sportz)
    then when you blit the image, instead of trying to blit "resizedImage" you have to put "somevariable" or whatever name you chose.

    this is because when you return a value in a funtion, you need a variable to return it to, so you do: variable = function()

  23. #7913
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Anti-QuickJay
    English please? I don't understand what that means.
    It means that it stays stuck on my image sports.jpg, or it won't leave my img.
    -= Double Post =-
    I added the variable into the screen blit, and fixed around it, but it still stays stuck on my image.
    Geändert von SportzOwner (08-13-2007 um 09:43 PM Uhr) Grund: Automerged Doublepost

  24. #7914
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    resize the image manually! you are using functons from evilmana and u dont even know how do they work ... >_>

  25. #7915
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    well how big is sportz.jpg originally? because if it is bigger than 512x512 then it wouldn't load in the first place.

  26. #7916
    Points: 3.273, Level: 35
    Level completed: 49%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    America
    Beiträge
    30
    Points
    3.273
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    The origenal is 600 x 150 pixels, it loads it just won't switch to current state ready, ill try to figure it out on my own.
    -= Double Post =-
    I fixed it.
    black = Color.new(0,0,0)
    pad = Controls.read()
    white = Color.new(255,255,255)
    --------------
    function printCentered(y,text,colo r)
    local length = string.len(text)
    local x = 240 - ((length*8)/2)
    screenrint(x,y,text,color)
    end
    --------------
    function scaleImage(newX, newY, theImage)

    resizedImage = Image.createEmpty(newX, newY)
    for x = 1, newX do
    for y = 1, newY do
    resizedImage:blit(x,y , theImage,
    math.floor(x*(theImage:wi dth()/newX)),
    math.floor(y*(theImage:he ight()/newY)),1,1)
    end
    end
    return resizedImage
    end
    --------------
    screen:clear(black)
    printCentered(131,"Starti ng up...",white)
    screen.waitVblankStart(3)
    screen.flip()
    --------------
    sportz = Image.load("sportz.jpg")
    -------------

    sportzimg = scaleImage(480,272, sportz) -- Resize image.

    while true do
    screen:blit(0,0, sportzimg, false) -- Show the resized image

    screen.waitVblankStart(30 0)
    screen.flip()

    --------------
    pad=Controls.read()
    screen:clear(black)
    screen:clear()

    printCentered(100,"Press Start",white)
    printCentered(200,"Powere d by Sportz",white)
    if pad:start() then
    dofile("menu.lua")
    end

    screen.waitVblankStart()
    screen.flip()

    end
    Had the end, end something i needed
    Geändert von SportzOwner (08-14-2007 um 12:53 PM Uhr) Grund: Automerged Doublepost

  27. #7917
    Points: 3.225, Level: 35
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 99,0%

    Registriert seit
    Jun 2007
    Beiträge
    11
    Points
    3.225
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    best place to go if u want to learn about Lua coding http://luaplayer.org/forums/index.php?topic=20.0

  28. #7918
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    hi this code here:
    Code:
    count = 5
    white = Color.new(255,255,255)
    function display()
    	screen:print(140, 248, count, white)
    end
    
    for count = 1, 5 do
    	while true do
    		screen:clear()
    		pad = Controls.read()
    		display()
    		if pad:square() and oldpad:square() ~= pad:square() then
    			oldpad = pad
    			break
    		end
    		oldpad = pad
    		screen.flip()
    		screen.waitVblankStart()
    	end
    end
    (by the way it relates to my game without showing it yet)

    basically i wanted a for loop that would decrease a variable, and show it using the display() function. I just wanted to know if anyone could tell me the specifics on why it never displays count decreasing.

    i found ways around it, but just want to know why it doesn't.

  29. #7919
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von johnjohnfroboy
    best place to go if u want to learn about Lua coding http://luaplayer.org/forums/index.php?topic=20.0
    Thats a lie.
    Its http://www.lua.org/manual/5.1/

  30. #7920
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    http://www.yongobongo.com
    PSN - yongobongo


 

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 09:00 PM Uhr.

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