Seite 117 von 342 ErsteErste ... 17 67 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 167 217 ... LetzteLetzte
Zeige Ergebnis 3.481 bis 3.510 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; nvm guys i fugured it out...

  
  1. #3481
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    nvm guys i fugured it out



  2. #3482
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    ok how can i make it were this image gos back and fourth?

    I want it inserted in this code were the code still works but I cant figure out were to put it
    Code:
    grass = Image.load("grass.png")
    player = Image.load("player.png")
    flower = Image.load("flower.png")
    start = Image. load("start.png")
    white = Color.new(255,255,255)
    counter = Timer.new()
    screenwidth = 480 - player:width()
    screenheight = 272 - player:width()
    
    Player = { }
    Player[1] = { x = 200, y = 50 }
    
    while true do
    pad = Controls.read()
    screen:clear()
     counter:start()
    
    
    
    screen:clear()
    currentTime = counter:time()
    
    if currentTime < 1000 then
    screen:print(100,100,"Loading",white)
    end
    if currentTime > 1000 then
    screen:print(100,100,"Loading",white)
    end
    if currentTime > 2000 then
    screen:print(100,100,"Loading.",white)
    end
    if currentTime > 3000 then
    screen:print(100,100,"Loading..",white)
    end
    if currentTime > 4000 then
    screen:print(100,100,"Loading...",white)
    end
    if currentTime > 5000 then
    screen:print(100,100,"Loading....",white)
    end
    if currentTime > 6000 then
    screen:print(100,100,"Loading....Almost done",white)
    end
    if currentTime > 7000 then
    screen:print(100,100,"Loading....Almost done.",white)
    end
    if currentTime > 8000 then
    screen:print(100,100,"Loading....Almost done..",white)
    end
    if currentTime > 9000 then
    screen:print(100,100,"Loading....Almost done...",white)
    end
    if currentTime > 10000 then
    screen:print(100,100,"Loading....Almost done...f",white)
    end
    if currentTime > 10100 then
    screen:print(100,100,"Loading....Almost done...fi",white)
    end
    if currentTime > 10200 then
    screen:print(100,100,"Loading....Almost done...fin",white)
    end
    if currentTime > 10300 then
    screen:print(100,100,"Loading....Almost done...fina",white)
    end
    if currentTime > 10400 then
    screen:print(100,100,"Loading....Almost done...final",white)
    end
    if currentTime > 10500 then
    screen:print(100,100,"Loading....Almost done...finaly",white)
    end
    if currentTime > 10600 then
    screen:print(100,100,"Loading....Almost done...finaly d",white)
    end
    if currentTime > 10700 then
    screen:print(100,100,"Loading....Almost done...finaly do",white)
    end
    if currentTime > 10800 then
    screen:print(100,100,"Loading....Almost done...finaly don",white)
    end
    if currentTime > 10900 then
    screen:print(100,100,"Loading....Almost done...finaly done",white)
    end
    if currentTime > 12000 then
    screen:print(150,110,"Get to the finish line",white)
    end
    if currentTime > 12100 then
    screen:print(150,120,"Lvl. 1",white)
    end
    if currentTime > 20000 then
    
    counter:stop()
    end
    
    --Were grass goes(top)
    screen:blit(0,0,grass)
    screen:blit(32,0,grass)
    screen:blit(64,0,grass)
    screen:blit(96,0,grass)
    screen:blit(128,0,grass)
    screen:blit(160,0,grass)
    screen:blit(192,0,grass)
    screen:blit(224,0,grass)
    screen:blit(256,0,grass)
    screen:blit(288,0,grass)
    screen:blit(320,0,grass)
    screen:blit(352,0,grass)
    screen:blit(384,0,grass)
    screen:blit(416,0,grass)
    screen:blit(448,0,grass)
    --More grass(right under top)
    screen:blit(0,32,grass)
    screen:blit(32,32,grass)
    screen:blit(64,32,grass)
    screen:blit(96,32,grass)
    screen:blit(128,32,grass)
    screen:blit(160,32,grass)
    screen:blit(192,32,grass)
    screen:blit(224,32,grass) 
    screen:blit(256,32,grass)
    screen:blit(288,32,grass)
    screen:blit(320,32,grass)
    screen:blit(352,32,grass)
    screen:blit(384,32,grass)
    screen:blit(416,32,grass)
    screen:blit(448,32,grass)
    --More grass(third row)
    screen:blit(0,64,grass)
    screen:blit(32,64,grass)
    screen:blit(64,64,grass)
    screen:blit(96,64,grass)
    screen:blit(128,64,grass)
    screen:blit(160,64,grass)
    screen:blit(192,64,grass)
    screen:blit(224,64,grass) 
    screen:blit(256,64,grass)
    screen:blit(288,64,grass)
    screen:blit(320,64,grass)
    screen:blit(352,64,grass)
    screen:blit(384,64,grass)
    screen:blit(416,64,grass)
    screen:blit(448,64,grass)
    --forth row
    screen:blit(0,96,grass)
    screen:blit(32,96,grass)
    screen:blit(64,96,grass)
    screen:blit(386,96,grass)
    screen:blit(416,96,grass)
    screen:blit(448,96,grass)
    --fith row
    screen:blit(0,128,grass)
    screen:blit(32,128,grass)
    screen:blit(64,128,grass)
    screen:blit(96,128,grass)
    screen:blit(128,128,grass)
    screen:blit(160,128,grass)
    screen:blit(192,128,grass)
    screen:blit(224,128,grass) 
    screen:blit(256,128,grass)
    screen:blit(288,128,grass)
    screen:blit(320,128,grass)
    screen:blit(352,128,grass)
    screen:blit(384,128,grass)
    screen:blit(416,128,grass)
    screen:blit(448,128,grass)
    --Sixth row
    screen:blit(0,160,grass)
    screen:blit(32,160,grass)
    screen:blit(64,160,grass)
    screen:blit(96,160,grass)
    screen:blit(128,160,grass)
    screen:blit(160,160,grass)
    screen:blit(192,160,grass)
    screen:blit(224,160,grass) 
    screen:blit(256,160,grass)
    screen:blit(288,160,grass)
    screen:blit(320,160,grass)
    screen:blit(352,160,grass)
    screen:blit(384,160,grass)
    screen:blit(416,160,grass)
    screen:blit(448,160,grass)
    --Seventh Row
    screen:blit(0,192,grass)
    screen:blit(32,192,grass)
    screen:blit(64,192,grass)
    screen:blit(96,192,grass)
    screen:blit(128,192,grass)
    screen:blit(160,192,grass)
    screen:blit(192,192,grass)
    screen:blit(224,192,grass) 
    screen:blit(256,192,grass)
    screen:blit(288,192,grass)
    screen:blit(320,192,grass)
    screen:blit(352,192,grass)
    screen:blit(384,192,grass)
    screen:blit(416,192,grass)
    screen:blit(448,192,grass)
    --eighth row
    screen:blit(0,224,grass)
    screen:blit(32,224,grass)
    screen:blit(64,224,grass)
    screen:blit(96,224,grass)
    screen:blit(128,224,grass)
    screen:blit(160,224,grass)
    screen:blit(192,224,grass)
    screen:blit(224,224,grass) 
    screen:blit(256,224,grass)
    screen:blit(288,224,grass)
    screen:blit(320,224,grass)
    screen:blit(352,224,grass)
    screen:blit(384,224,grass)
    screen:blit(416,224,grass)
    screen:blit(448,224,grass)
    --ninth Row
    screen:blit(0,256,grass)
    screen:blit(32,256,grass)
    screen:blit(64,256,grass)
    screen:blit(96,256,grass)
    screen:blit(128,256,grass)
    screen:blit(160,256,grass)
    screen:blit(192,256,grass)
    screen:blit(224,256,grass) 
    screen:blit(256,256,grass)
    screen:blit(288,256,grass)
    screen:blit(320,256,grass)
    screen:blit(352,256,grass)
    screen:blit(384,256,grass)
    screen:blit(416,256,grass)
    screen:blit(448,256,grass)
    --Start
    screen:blit(195,45,start)
    --Flower paths(around start image)
    screen:blit(230,25,flower)
    screen:blit(220,25,flower)
    screen:blit(210,25,flower)
    screen:blit(200,25,flower)
    screen:blit(190,25,flower)
    screen:blit(180,25,flower)
    screen:blit(170,25,flower)
    screen:blit(170,30,flower)
    screen:blit(170,42,flower)
    screen:blit(170,50,flower)
    screen:blit(170,60,flower)
    screen:blit(170,70,flower)
    screen:blit(180,70,flower)
    screen:blit(190,70,flower)
    screen:blit(200,70,flower)
    screen:blit(210,70,flower)
    screen:blit(220,70,flower)
    screen:blit(230,70,flower)
    
    
    
    
    
    
    screen:blit(300,220,flower)
    
    
    
    
    
    
    screen:blit(Player[1].x,Player[1].y,player)
    
    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 2
    end
    
    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 2
    end
    
    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 2
    end
    
    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 2
    end
    
    
    
    
    screen.waitVblankStart()
    screen.flip()
    end

  3. #3483
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    I don't know what you're asking for. If it's AI or animation, specify which and I (or someone else) can help, but for now your code is way too inefficient.

    Read this before you continue:
    http://evilmana.com/tutorials/lua_tutorial_07.php

    What you're looking for there is:
    Code:
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    If you don't understand, there's an explanation in the tutorial.

    Also, 'finaly' is spelled with two Ls.

  4. #3484
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Aphonia
    I don't know what you're asking for. If it's AI or animation, specify which and I (or someone else) can help, but for now your code is way too inefficient.

    Read this before you continue:
    http://evilmana.com/tutorials/lua_tutorial_07.php

    What you're looking for there is:
    Code:
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    If you don't understand, there's an explanation in the tutorial.

    Also, 'finaly' is spelled with two Ls.
    Yes i know that code, but i dont use it because it blits over the text.

    and its animation...i have a code right their i just dont know were to put it
    -= Double Post =-
    and i will fix the finally lol
    Geändert von the undead (09-14-2006 um 04:32 PM Uhr) Grund: Automerged Doublepost

  5. #3485
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    The undead, you have A LOT of unneeded code. Read this tutorial. It will help you slim all image code down to 5 or 6 lines.

  6. #3486
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    Yes i know that code, but i dont use it because it blits over the text.

    and its animation...i have a code right their i just dont know were to put it
    -= Double Post =-
    and i will fix the finally lol

    then all you do, is FISRT blit all the grass stuff, THEN print your text. itll show.
    --------------------------------------------------------------------------------------

  7. #3487
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    then all you do, is FISRT blit all the grass stuff, THEN print your text. itll show.
    I already tried that, but I will try again

  8. #3488
    MjW
    MjW ist offline
    QJ Gamer Green
    Points: 6.398, Level: 52
    Level completed: 24%, Points required for next Level: 152
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Lost in the woods..
    Beiträge
    804
    Points
    6.398
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Offtopic :
    I am not coding or anything, I'm just trying to find some info about a lua game. So excuse my noob questions. Its been a couple of days now but i didn't get any ideas.
    So if some lua coders have some spare time please have a look at the thread i started in psp general and give me a more professional opinion about it.
    It would be highly appreciated!

    The thread with pics and the game is here
    [FONT=garamond][size=3]Edison Carter Rulez![/size][/FONT]

    [b][u]There are 2 categories of n00bs :[/u]
    The ones that start as n00bs and advance.
    And the ones that get born as n00bs and remain.[/b]

  9. #3489
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Ok im trying to put this code in
    Code:
    Font Font.load(btseps2.ttf)
    But it says error:a.lua:3:'=' expected near font

    so i put this in instead
    Code:
    Font = Font.load(btseps2.ttf)
    but now I get this error:a.lua:3: attempt to index global 'font' a nil value

    What is wrong?

  10. #3490
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    is you path to the font correct? and are you declaring it before you use it?

  11. #3491
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Bronx
    is you path to the font correct? and are you declaring it before you use it?
    yes the path to the file is right(its in the same folder)
    and what do you mean declaring it?
    right now im just loading it

  12. #3492
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    ANewFont = Font.load("btseps2.ttf")

  13. #3493
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    Code:
    ANewFont = Font.load("btseps2.ttf")
    Ok thanks, ill try that
    -= Double Post =-
    I still get the nil value error
    Geändert von the undead (09-15-2006 um 07:28 PM Uhr) Grund: Automerged Doublepost

  14. #3494
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Are you using the latest LuaPlayer?

  15. #3495
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    Are you using the latest LuaPlayer?
    yes I am

  16. #3496
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Show the line of code you are using now to check if you got the syntax correct.

  17. #3497
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    Show the line of code you are using now to check if you got the syntax correct.
    Im starting a program, but i need to test this font
    Code:
    red = Color.new(255, 0, 0)
    ANewFont = Font.load("btseps2.ttf")
    
    
    screen:print(200, 100, "Font test", ANewFont)
    
    screen.flip()
    while true do
    screen.waitVblankStart()
    end

  18. #3498
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    What Line do you get the error on?
    sidenote: You are not meant to use screenrint with fonts, ou would want screen:fontprint(ANewFont , 200, 100, "Font test")

  19. #3499
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    What Line do you get the error on?
    sidenote: You are not meant to use screenrint with fonts, ou would want screen:fontprint(ANewFont , 200, 100, "Font test")
    ahh i see, ididnt know that...um line 3...let me try that
    -= Double Post =-
    I used that, i still get that nil value error...line 3
    Geändert von the undead (09-15-2006 um 07:55 PM Uhr) Grund: Automerged Doublepost

  20. #3500
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard Lua help. cant find the lua help thread if a mod could move this thanks

    -- maze of doom

    menu = Image.load("menu.jpeg")
    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)
    oldpad = Controls.read()
    while true do
    pad = Controls.read()
    screen:blit(0,0,menu)
    screen.print (10, 100, "Press X to Start" green)
    screen.print (20, 150, "Maze of Doom created by: GuitarGod1124 also known as GuitarGod1134" orange)
    screen:clear()
    if pad:cross()then
    screen.print (10, 100, "Coming Soon...." orange)
    end
    screen.flip()
    screen.waitVblankStart()
    oldpad = pad
    end

    okay everytime I try to start this it gives me an error saying
    Error: SCRIPT.LUA:13: ')' expected near 'green'
    Press start to restart

    can someone help? At first i thought i didnt flip it on to the on screen buffer but i did. didnt i?
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  21. #3501
    QJ Is Cluttered.
    Points: 26.159, Level: 96
    Level completed: 81%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    New Zealand.
    Beiträge
    6
    Points
    26.159
    Level
    96
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    menu = Image.load("menu.jpeg")
    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)
    green = Color.new(0,255,0)
    oldpad = Controls.read()
    while true do
    pad = Controls.read()
    screen:blit(0,0,menu)
    screen.print (10, 100, "Press X to Start", green)
    screen.print (20, 150, "Maze of Doom created by: GuitarGod1124 also known as GuitarGod1134", orange)
    screen:clear()
    if pad:cross()then
    screen.print (10, 100, "Coming Soon....", orange)
    end
    screen.flip()
    screen.waitVblankStart()
    oldpad = pad
    end
    Should work, there were a few errors in there, like not putting a comma after some of your arguments, and not defining the color green, but I fixed it up.

  22. #3502
    QJ Gamer Bronze
    Points: 5.924, Level: 49
    Level completed: 87%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Earth, UK
    Beiträge
    457
    Points
    5.924
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    menu = Image.load("menu.jpeg")
    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)
    green = Color.new(0,255,0)
    oldpad = Controls.read()
    while true do
    pad = Controls.read()
    screen:clear()
    screen:blit(0,0,menu)
    screen:print (10, 100, "Press X to Start", green)
    screen:print (20, 150, "Maze of Doom created by: GuitarGod1124 also known as GuitarGod1134", orange)
    if pad:cross()then
    screen:print (10, 100, "Coming Soon....", orange)
    end
    screen.flip()
    screen.waitVblankStart()
    oldpad = pad
    end
    Same as Macca's, except for the screen:clear() needs to be before you screen:blit or screenrint else you'll clear the screen as soon as they are put on.
    And Im fairly sure is
    Code:
    screen:blit and screen:print
    not
    Code:
    screen.print and screen.blit
    .

    Correct me if im wrong
    <<Put A message Here>>
    <<Just made another rubbish website visit it here.>>

  23. #3503
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    okay thanks guys
    -= Double Post =-
    O WOW i had no idea i didnt define green. missed that lol.
    im getting a image loading error. where do i put my menu.jpeg?
    Geändert von GuitarGod1134 (09-20-2006 um 02:35 AM Uhr) Grund: Automerged Doublepost
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  24. #3504
    QJ Gamer Bronze
    Points: 5.924, Level: 49
    Level completed: 87%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Earth, UK
    Beiträge
    457
    Points
    5.924
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    in the same folder as the index.lua. If you put in in another folder then you would have to change
    Code:
    menu = Image.load("menu.jpeg")
    to
    menu = Image.load("foldername/menu.jpeg")
    <<Put A message Here>>
    <<Just made another rubbish website visit it here.>>

  25. #3505
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    okay thanks
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  26. #3506
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    There is a link in the stickys
    HELP ME HAIRY LEG!!!!

    I have a 1.5 (downgraded) US PSP
    [code]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
    ( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
    \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
    _ _ _ _ _
    / \ / \ / \ / \ / \
    ( A | d | m | i | n )
    \_/ \_/ \_/ \_/ \_/ [/code]

  27. #3507
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    i am having a problem loading this for some reason..
    Code:
    bg = Image.load("background.png")
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    white = Color.new(255,255,255)
    oldpad = Controls.read()
    font = Font.load("visitor.ttf")
    font:setPixelSizes(0, 32)
    
    RN0 = math.random(1,3)
    RN1 = math.random(1,3)
    RN2 = math.random(1,3)
    
    while true do
    pad = Controls.read()
    if pad:square() then
    RN0 = math.random(1,3)
    end
    
    if pad:square() then
    RN1 = math.random(1,3)
    end
    
    if pad:square() then
    RN2 = math.random(1,3)
    end
    
    screen:fontPrint(font, 165,150, RN0, red)
    
    screen:fontPrint(font, 195,150, RN1, red)
    
    screen:fontPrint(font, 220,150, RN2, red)
    
    elseif (math.random(1,3) > 1) then 
    screen:blit(0,0, bg)
    screen:fontPrint(font, 10,150, "YOU WON THE JACKPOT!!", green)
    end
    
    elseif (math.random(1,3) > 2) then
    screen:blit(0,0, bg)
    screen:fontPrint(font, 10,150, "YOU WON THE JACKPOT!!", green)
    end
    
    elseif (math.random(1,3) > 3) then 
    screen:blit(0,0, bg)
    screen:fontPrint(font, 10,150, "YOU WON THE JACKPOT!!", green)
    end
    
    screen.flip()
    screen.waitVblankStart()
    oldpad = pad
    end
    Geändert von psphacker12. (09-21-2006 um 01:45 PM Uhr)

  28. #3508
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    well you have no screen:clear()

  29. #3509
    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

    you cant just use elseif. You have to use it like this:

    if bla==bla2 then
    something
    elseif bla~=bla2 then
    somethingelse
    end

    also
    Code:
    if pad:square() then
    RN0 = math.random(1,3)
    end
    
    if pad:square() then
    RN1 = math.random(1,3)
    end
    
    if pad:square() then
    RN2 = math.random(1,3)
    end
    can be:
    Code:
    if pad:square() then
    RN0 = math.random(1,3)
    RN1 = math.random(1,3)
    RN2 = math.random(1,3)
    end
    Another thing, put this in the main loop once and in the beginning:
    Code:
    screen:blit(0,0, bg)
    And yeah, you should have "screen:clear()" in your main loop. In the beginning and before the "screen:blit(0,0, bg)".
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  30. #3510
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard help

    idk it says you won the jackpot automatically when i start the game.. heres the code,
    Code:
    System.usbDiskModeActivate()
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    white = Color.new(255,255,255)
    oldpad = Controls.read()
    font = Font.load("visitor.ttf")
    font:setPixelSizes(0, 32)
    screen:clear()
    math.randomseed(os.time())
    RN0 = math.random(1,3)
    RN1 = math.random(1,3)
    RN2 = math.random(1,3)
    RN9 = complete
    bg = Image.load("background.png")
    
    while true do
      
    pad = Controls.read()
    
      if pad:square() then
      RN0 = math.random(1,3)
      RN1 = math.random(1,3)
      RN2 = math.random(1,3)
      end
    
        screen:fontPrint(font, 165,150, RN0, red)
    
        screen:fontPrint(font, 195,150, RN1, red)
    
        screen:fontPrint(font, 220,150, RN2, red)
    
    if RN0 == 1 and RN9 == complete then
    RN9 = one
    end
    
    if RN1 == 1 and RN9 == one then
    RN9 = two
    end
    
    if RN2 == 1 and RN9 == two then
    RN9 = three
    end
    
    
    if RN9 == three then
    RN9 = complete
    screen:clear()
    screen:blit(0,0, bg)
    screen:fontPrint(font, 10,150, "YOU WON THE JACKPOT!!", green)
    end
    screen.flip()
    screen.waitVblankStart()
    end
    -= Double Post =-
    bump!!!!!!!!!!!!!!!!!!!!! !!!!!
    Geändert von psphacker12. (09-22-2006 um 11:32 AM Uhr) Grund: Automerged Doublepost


 

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 07:53 AM Uhr.

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