Seite 166 von 342 ErsteErste ... 66 116 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 216 266 ... LetzteLetzte
Zeige Ergebnis 4.951 bis 4.980 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; Try to indent and put spaces...That way your code is much neater to look at and better organization.....

  
  1. #4951
    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

    Try to indent and put spaces...That way your code is much neater to look at and better organization..



  2. #4952
    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

    Yes, loading another file via dofile(".lua") will stop all scripts besides what you just loaded... Meaning you have to have some sort of loop to keep that script from reaching the bottom...

    ...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


  3. #4953
    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

    Zitat Zitat von SG57
    Yes, loading another file via dofile(".lua") will stop all scripts besides what you just loaded... Meaning you have to have some sort of loop to keep that script from reaching the bottom...
    No it doesn't, it runs the script you just loaded inside the script that you called it from. Using dofile recklessly (ie circlar dofiles) will lead to internal memory leaks and stack overflows.

  4. #4954
    Points: 4.797, Level: 44
    Level completed: 24%, Points required for next Level: 153
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    47
    Points
    4.797
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    I need help i wanne know how to change the current direction
    like if the current direction is MS0:NewMap/
    and i want to change it to MS0:NewMap/stuff/
    -= Double Post =-
    Zitat Zitat von yaustar
    No it doesn't, it runs the script you just loaded inside the script that you called it from. Using dofile recklessly (ie circlar dofiles) will lead to internal memory leaks and stack overflows.
    is that dangerous ? because i am working on a software and i have dozen of dofiles like when i click start menu dofile startmenu when i click it down dofile desktop.
    Geändert von mbr7 (01-09-2007 um 03:40 AM Uhr) Grund: Automerged Doublepost

  5. #4955
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    So I take it SG57 is wrong and a new loop in each file is not the way to go?

    Zitat Zitat von yaustar
    No it doesn't, it runs the script you just loaded inside the script that you called it from. Using dofile recklessly (ie circlar dofiles) will lead to internal memory leaks and stack overflows.
    Is this dangerous? Should I put all my code in one file?

    EDIT: Off-topic: Is the X360 Gamercard avatar for the forums for premium members only? Coz mine isn't showin.

  6. #4956
    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

    Bottom line, if you use dofile, make sure you use then correctly. For those C/C++ coders out there, you are essentially calling a function in a function. If those functions never end, then the variables on the stack don't get cleared up and overflow.

    To check if your app will have this problem, he is an exercise to do. Scan you 'root' file. Replace all the dofiles calls with the contents of the files that you are calling. Once you have done that you should have one file with the contents of other files in it. Do the same thing again until there are no more dofile calls. If you find that you never stop doing this, then you have a problem and you can see why.

  7. #4957
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    how about if the script that has the dofile merely loads variables and functions? would it be 'dangerous' then?
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  8. #4958
    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

    Dofiles arent bad its ok if your using them to load stuff or go to a new area or something but only when they are nessceary (lol spelling). Just dont overdue it like

    --my app
    --colors
    dofile
    --pics
    dofile
    --fonts
    dofile
    while true do
    --main loop and functions
    dofile
    end
    --flip and stuff
    dofile

    just dont over due it.
    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!

  9. #4959
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mbr7
    I need help i wanne know how to change the current direction
    like if the current direction is MS0:NewMap/
    and i want to change it to MS0:NewMap/stuff/
    -= Double Post =-


    is that dangerous ? because i am working on a software and i have dozen of dofiles like when i click start menu dofile startmenu when i click it down dofile desktop.
    Changing the current directory is easy.

    Say we're in a directory called "dir" and it contains a folder called "dir2"

    System.currentDirectory(" ./dir2")

    Then to goup a directory:

    System.currentDirectory(" ./..")

    And for more directory functions, check the lua examples snippets etc thread at the bottom is a filebrowser snippet I wrote.

  10. #4960
    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 GuitarGod1134
    Dofiles arent bad its ok if your using them to load stuff or go to a new area or something but only when they are nessceary (lol spelling). Just dont overdue it like

    --my app
    --colors
    dofile
    --pics
    dofile
    --fonts
    dofile
    while true do
    --main loop and functions
    dofile
    end
    --flip and stuff
    dofile

    just dont over due it.
    I only use dofile's to load a menu or options, Evrything else is inside one script, I really dont like to put more than 3 dofiles in a single script.
    XBOX360 AVATAR: You need to have a regular avatar loaded first.

  11. #4961
    Designs
    Points: 14.040, Level: 76
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Canada
    Beiträge
    1.395
    Points
    14.040
    Level
    76
    Downloads
    0
    Uploads
    0

    Standard

    is it possible to overclock a psp in lua. so when the game starts it sets the psp to 333 mhz automatically

  12. #4962
    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

    You need cools lua player mod.

  13. #4963
    .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

    Standard

    333 mhz is the max anyway, you can also use the systemext or something lrx y be2003 on ps2dev

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

  14. #4964
    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

    Nevermind, In his release thread he said he removed the overclocking function cause it can be dangerous if you dont use it right.

  15. #4965
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    well...I use it and it works fine. (cools' mod 2)
    i just set the cpu speed to 333 in the beginning and at the end i set it back to 222. everything's worked normal, as expected.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  16. #4966
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    You've failed to answer my main question. How do you keep a image from disapearing after 1 frame? Dark_Merlins way doesn't work.

  17. #4967
    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 Cheez Pirate
    You've failed to answer my main question. How do you keep a image from disapearing after 1 frame? Dark_Merlins way doesn't work.
    Why dont you find out? You cant expect to come here and ask a million questions and hope someone answers it.

  18. #4968
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Cheez Pirate
    You've failed to answer my main question. How do you keep a image from disapearing after 1 frame? Dark_Merlins way doesn't work.
    well...i dont know what your code is but you could set a variable for it like this:

    Code:
    imageblitted = false
    ...
    while true do
    ...
    ...
    if something then
    imageblitted = true
    end
    ...
    ...
    if imageblitted = true then
    screen:blit(x, y, image)
    end
    ...
    ...
    end
    that should give you a basic concept. :)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  19. #4969
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    well...i dont know what your code is but you could set a variable for it like this:

    Code:
    imageblitted = false
    ...
    while true do
    ...
    ...
    if something then
    imageblitted = true
    end
    ...
    ...
    if imageblitted = true then
    screen:blit(x, y, image)
    end
    ...
    ...
    end
    that should give you a basic concept. :)
    That's understandable. Thanks.

    And to pspgamer81. I always try to find out before I post.

  20. #4970
    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 Cheez Pirate
    That's understandable. Thanks.

    And to pspgamer81. I always try to find out before I post.
    You can try a little bit harder than, I was like this before, I didnt know anything, But once you sit down, Go over the functions, Understand the code, Then you wont need to be coming here alot.

  21. #4971
    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

    Cheez_Pirate - Dont mind pspgamer. He's just a little social butterfly... Loves to post, not saying what he says is 100% true... He's even hypicritical at times, like just there... Funny how he doesnt want you posting a zillion questions/problems where he is already half way to a zillion... Maybe he doesnt like competition ;)

    And honestly, just learn the game programming theory, or if your still struggling with the whole 'programming concept' then make small demos and read tutorials. Once you get those 2 down, nothings stopping you from making a game in any language, as long as your willing to learn that languages syntax... Oh and if that machine allows arbitrary code to be ran :X

    ...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


  22. #4972
    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 pspgamer81
    You can try a little bit harder than, I was like this before, I didnt know anything, But once you sit down, Go over the functions, Understand the code, Then you wont need to be coming here alot.
    lol, i wouldnt be talking. im not even sure if YOU understand the code.

    OT:

    you sig text makes no sense. you cant die in hell, dont you have to be dead to even get there?
    --------------------------------------------------------------------------------------

  23. #4973
    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

    Nope, You can be alive.
    Lets get back on topic.

  24. #4974
    QJ Gamer Blue
    Points: 4.936, Level: 44
    Level completed: 93%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    In the shadows..
    Beiträge
    135
    Points
    4.936
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    hey i asked my ques in another thread sometime back when someone told me to post my question in this thread instead.. so here it is..

    My question is.. Say for example i have a file containing many lines of text/code... Now what i want to do is when i press the button 'x' then the screen should show the text which is on the offset 0x0002DE0 , how can i do this?

    when i use the file:seek("set",0x0002DE0 ) [suggested by youresam] then it prints 11744 on the screen but i dont want that as the output.. i want it to print the value at that offset in the file it has opened..
    for example, there is a file called hello.reg in which at the offset 0x0002DE0 the value 1111 is stored, so when it opens the file, i want it to show the value 1111 instead of 11744 .. now some of you may say that instead of using 0x0002DEO i should use 0xF to show 1111 but that value is dynamic, if i change 1111 to 2222 then it should show that value at the offset 0x0002DE0 ..

    i dont know if you understood what i mean to say but thats what i mean :-) .. also if this is not possible then how can i open up a file in hex mode on the psp using lua? if i can open the file in hex mode then i may be able to pick up from there to do the function i want it to do..

  25. #4975
    QJ Gamer Silver
    Points: 7.740, Level: 58
    Level completed: 95%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    608
    Points
    7.740
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    >_< Can someone help me with my code, it is really slow and the fps meter shows 0 all the time.

    Heres the files http://upload.team-duck.com/users/Da...0Espionage.rar

  26. #4976
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I've updated my code a little. Now when I press X on menustatus = 1 it will go to the singleplayer1 menu. I want it to go back to the main menu when triangle is pressed. It won't work. I want to go to singleplayer2 menu when X is pressed in singleplayer1 menu. It won't work.

    When I try to load multiplayer by pressing X on menustatus = 2 it says the image could not be found. Returned as boolean. But I checked the paths and filenames like 10 times and it's all right but it won't load the multiplayer1 menu.

    Code:
            white = Color.new(255,255,255)
                    menustatus = 1
                             singleplayer1 = false
                          singleplayer2 = false
                          multiplayer1 = false
                  menu1 = Image.load("images/menu1.png")
                  cursor1 = Image.load("images/cursor1.png")
                  multiplayer1 = Image.load("images/multiplayer1.png")
                  singleplayer1 = Image.load("images/singleplayer1.png")
                  singleplayer2 = Image.load("images/singleplayer2.png")
    oldpad = Controls.read()
           while true do
    pad = Controls.read()
    screen:clear(white)
    screen:blit(0,0,menu1)
                if menustatus == 1 then
                   screen:blit(280,172,cursor1)
    end
                if menustatus == 2 then
                   screen:blit(280,196,cursor1)
    end
                if pad:down() and oldpad:down() ~= pad:down() then
                   menustatus = menustatus + 1
    end
                if pad:up() and oldpad:up() ~= pad:up() then
                   menustatus = menustatus - 1
    end
                if menustatus == 0 then
                   menustatus = 1
    end
                if menustatus == 3 then
                   menustatus = 2
    end
    --singleplayer1
                if pad:cross() and menustatus == 1 then
                   singleplayer = true
    end
                if singleplayer == true then
                   screen:clear(white)
                   screen:blit(0,0,singleplayer1)
    end
                if singleplayer1 == true and pad:cross() then
                   singleplayer2 = true
                   singleplayer1 = false
    end
                if pad:triangle() and singleplayer1 == true then
                   singleplayer1 = false
    end
    --singleplayer2
                if singleplayer2 == true then
                     screen:clear(white)
                     screen:blit(0,0,singleplayer2)
    end
                if pad:triangle() and singleplayer2 == true then
                     singleplayer2 = false
    end
    --multiplayer1
                if pad:cross() and menustatus == 2 then
                     multiplayer1 = true
    end
                if multiplayer1 == true then
                     screen:clear(white)
                     screen:blit(0,0,multiplayer1)
    end
                if pad:triangle() and multiplayer1 == true then
                     multiplayer1 = false
    end
    --reloading main menu
                if singleplayer1 == false or multiplayer1 == false and singleplayer2 == false then
                     screen:clear(white)
                     screen:blit(0,0,menu1)
    end
    --reloading singleplayer1 menu
                if singleplayer2 == false and menu1 == false then
                     screen:clear(white)
                     screen:blit(0,0,singleplayer1)
    end
    screen.waitVblankStart()
    screen.flip()
    oldpad = pad
    end

  27. #4977
    QJ Gamer Silver
    Points: 8.002, Level: 60
    Level completed: 26%, Points required for next Level: 148
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    The Matrix
    Beiträge
    1.090
    Points
    8.002
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    i was wondering how to delete a directory and ALL its files, like deleting "/psp/game/mygame/temp/" then "*.*"
    -= Double Post =-
    i tried
    Code:
    System.removeFile("*.*")
    Didn't work
    Geändert von CoolRaccoon (01-10-2007 um 12:58 PM Uhr) Grund: Automerged Doublepost
    http://i28.tinypic.com/1znoljt.png
    lolololololol - Reach 100,000 Gamerscore

  28. #4978
    Points: 3.536, Level: 37
    Level completed: 24%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    14
    Points
    3.536
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    I have a huge problem i really need help in. I am making a app that requires alot of animation and many of my animation use up to 100 frames. I am using the anilib V.4, and al my frames are in jpg format. here are my problems

    1. trieng to use .png images give me a "cannot load image" error
    2. the animation will work fine if less than 30 frames, but if its over 30 my program freeezes.




    this is really holding me back if any one has any advice it would be greatly appreciated

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

    Zitat Zitat von yotop456
    I have a huge problem i really need help in. I am making a app that requires alot of animation and many of my animation use up to 100 frames. I am using the anilib V.4, and al my frames are in jpg format. here are my problems

    1. trieng to use .png images give me a "cannot load image" error
    2. the animation will work fine if less than 30 frames, but if its over 30 my program freeezes.




    this is really holding me back if any one has any advice it would be greatly appreciated
    Write your own or extend animlib to unload any animation frame images that are not being used from memory and load the frames that you need next or only load the images you need for the current frame. It be relatively slow but you have no choice since you are running out of memory.

    Why on earth would you need 100 frames for an animation any way?

  30. #4980
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    i'll help out some, cheez pirate.

    first off, theres alot of 'if' statements that can be cleaned up...too little time over here to type explanations. i'll just fix it up for you for now.

    take a look at this and see if you see an error that will obviously give you some trouble later on:

    Code:
    singleplayer1 = false
    singleplayer2 = false
    singleplayer1 = Image.load("images/singleplayer1.png")
    singleplayer2 = Image.load("images/singleplayer2.png")
    Code:
    white = Color.new(255,255,255)
    menustatus = 1
    singleplayer1 = false
    singleplayer2 = false
    multiplayer1 = false
    menu1 = Image.load("images/menu1.png")
    cursor1 = Image.load("images/cursor1.png")
    multiplayer1 = Image.load("images/multiplayer1.png")
    singleplayer1image = Image.load("images/singleplayer1.png")
    singleplayer2image = Image.load("images/singleplayer2.png")
    
    --better than oldpad
    upPressed = false
    downPressed = false
    leftPressed = false
    rightPressed = false
    crossPressed = false
    squarePressed = false
    trianglePressed = false
    circlePressed = false
    
    while true do
    
    	pad = Controls.read()
    
    	screen:clear(white)
    	screen:blit(0,0,menu1)
    
    	if menustatus == 1 then
              	     screen:blit(280,172,cursor1)
    	elseif menustatus == 2 then
                   	screen:blit(280,196,cursor1)
    	end
    
    	if pad:down() then
    		if downPressed == false then
    			menustatus = menustatus + 1
    			if menustatus > 2 then
    				menustatus = 2
    			end
    			downPressed = true
    		end
    	else
    		downPressed = false
    	end
    
    	if pad:up() then
    		if upPressed == false then
    			menustatus = menustatus - 1
    			if menustatus < 1 then
    				menustatus = 1
    			end
    			upPressed = true
    		end
    	else
    		upPressed = false
    	end
    
    	--singleplayer1
    	if pad:cross() then
    		if crossPressed == false then
    			if menustatus == 1 and singleplayer1 == false then
    				singleplayer = true
    			elseif menustatus == 1 and singleplayer1 == true then
    				singleplayer2 = true
    				singleplayer1 = false
    			elseif menustatus == 2 and multiplayer1 == false then
    				multiplayer1 = true
    			end
    			crossPressed = true
    		end
    	else
    		crossPressed = false
    	end
    
    	if pad:triangle() then
    		if singleplayer1 == true then
    			singleplayer1 = false
    		end
    		if singleplayer2 == true then
    			singleplayer2 = false
    		end
    		if multiplayer1 == true then
    			multiplayer1 = false
    		end
    	end
    
    	if singleplayer1 == true then
               	    screen:blit(0,0,singleplayer1image)
    	end
    
    	if singleplayer2 == true then
                  	   screen:blit(0,0,singleplayer2image)
    	end
    
    	if multiplayer1 == true then
                 	    screen:blit(0,0,multiplayer1)
    	end
    
    	screen.waitVblankStart()
    	screen.flip()
    end
    i'm tired.
    this is what i was able to do in a few minutes. you'll see some things are missing. sorry about that. but you should be able to figure it out from there. gotta sleep. hope this helped. :)
    night!
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]


 

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 .