Seite 309 von 342 ErsteErste ... 209 259 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 ... LetzteLetzte
Zeige Ergebnis 9.241 bis 9.270 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; I need an efficient way to change levels in my game, Arkanoid Deluxe. Ive tried functions, they don't work. Ive ...

  
  1. #9241
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    I need an efficient way to change levels in my game, Arkanoid Deluxe. Ive tried functions, they don't work. Ive tried dofile, it doesn't work. All I need to do is restate
    Code:
    Block = {}
    Block[1] = {x = 0, y = 0, visible = "true"}
    For all 24 block. Because all that changes every level is the block positions.

    Please Help.


    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  2. #9242
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for i = 1, 24 do
         Block[i].visible = "true"
    end
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  3. #9243
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    Code:
    for i = 1, 24 do
         Block[i].visible = "true"
    end
    I have that. I need to restate the x and y but it doesn't.
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  4. #9244
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for i = 1, 24 do
         Block[i].x = 0
         Block[i].y = 0
         Block[i].visible = "true"
    end
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  5. #9245
    QJ Gamer Bronze
    Points: 8.665, Level: 62
    Level completed: 72%, Points required for next Level: 85
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    758
    Points
    8.665
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for i = 1, 24 do
      Block[i].visible = "true"
      Block[i].x = 0
      Block[i].y = 0
    end
    ??
    Like that?

    edit: I lost.

  6. #9246
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Don't worry, Ummhhh. How many people on ad-hoc could you get to play at One given Time?

  7. #9247
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    Code:
    for i = 1, 24 do
         Block[i].x = 0
         Block[i].y = 0
         Block[i].visible = "true"
    end
    But the Blocks Positions are different.
    I would have done that.

    -=Double Post Merge =-
    Zitat Zitat von dan369 Beitrag anzeigen
    Don't worry, Ummhhh. How many people on ad-hoc could you get to play at One given Time?
    Ive tried dofile
    Geändert von xXChromeXx (08-13-2008 um 05:39 PM Uhr) Grund: Automerged Doublepost
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  8. #9248
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for i = 1, 24 do
         Block[i].x = something * i
         Block[i].y = something * i
         Block[i].visible = "true"
    end
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  9. #9249
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    Code:
    for i = 1, 24 do
         Block[i].x = something * i
         Block[i].y = something * i
         Block[i].visible = "true"
    end
    How does that work?? All it does is multiply 1 value by I
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  10. #9250
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    sorry here do something like this, this is the code taken from one of my breakout games.

    Code:
    function display_bricks(brick_number)
    	for i = 1, brick_number do
    		if bricks[i].enabled == 1 then
    			if i <= 6 then
    				row = 1
    			elseif i <= 12 then
    				row = 2
    			elseif i <= 18 then
    				row = 3
    			end
    			bricks[i].x = 30 + (((i - 1) - ((row - 1) * 6)) * 70)
    			bricks[i].y = 20 + ((row - 1) * 20)
    			screen:blit(bricks[i].x, bricks[i].y, bricks[i].img)
    		end
    	end
    end
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  11. #9251
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    sorry here do something like this, this is the code taken from one of my breakout games.

    Code:
    function display_bricks(brick_number)
    	for i = 1, brick_number do
    		if bricks[i].enabled == 1 then
    			if i <= 6 then
    				row = 1
    			elseif i <= 12 then
    				row = 2
    			elseif i <= 18 then
    				row = 3
    			end
    			bricks[i].x = 30 + (((i - 1) - ((row - 1) * 6)) * 70)
    			bricks[i].y = 20 + ((row - 1) * 20)
    			screen:blit(bricks[i].x, bricks[i].y, bricks[i].img)
    		end
    	end
    end
    Can you explain it im kind of new
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  12. #9252
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    basically it splits the bricks up into 3 rows, depending on the number of bricks you have on each row change the numbers 6, 12, and 18 so that you do get 3 rows or add some more code in if you want more rows.

    the second part displays the brick at an x and y position depending on which row and brick that it is

    if you need a more detailed explanation than ill have to do it tomorrow as im going bed now unless someone else that understands it tells you (not dan369)
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  13. #9253
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Fatboy he wants each level to have all kinds of different positions, not just to reset for each level

    What I would do is make a 3d table - a table of tables of tables. First table is of all the different level tables and each level table is a table blocks, each block being a table. Simply switch which subtable of the first table you access for all the blocks to change which level youre on and have each different subtable be a different level.

    If that makes any sense....

  14. #9254
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    if you need a more detailed explanation than ill have to do it tomorrow as im going bed now unless someone else that understands it tells you (not dan369)
    Kind. Anyway, i'm not gunna bother trying to explain myself. because i don't know.
    I'm wondering about using strings, is there a good tut or explanation about them?

    Edit: Is it also possible to store tables in .txt files? if so he could dofile Various .txt files, which have drifferent tables. Just a Suggestion

  15. #9255
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    Fatboy he wants each level to have all kinds of different positions, not just to reset for each level

    What I would do is make a 3d table - a table of tables of tables. First table is of all the different level tables and each level table is a table blocks, each block being a table. Simply switch which subtable of the first table you access for all the blocks to change which level youre on and have each different subtable be a different level.

    If that makes any sense....
    ???????
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  16. #9256
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    http://lua-users.org/wiki/StringLibraryTutorial

    chrome explain what you understand and what you dont and ill try to elaborate

  17. #9257
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    http://lua-users.org/wiki/StringLibraryTutorial

    chrome explain what you understand and what you dont and ill try to elaborate
    The 3D table, like how to make it
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  18. #9258
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    make a table:
    Code:
    levels = {}
    with some tables inside it:
    Code:
    levels = {{},{},{}}
    with some more tables inside them:
    Code:
    levels = {
    {{},{},{}},
    {{},{},{}},
    {{},{},{}}
    }
    The very inside tables are each a block. The tables a level above those are a "level" and the whole big table is all the levels. When you want to be on level 1, use levels[1][1]-levels[1][howevermanyblocksthatleve lhas]
    When you want level 5 use levels[5][1] to levels[5][howevermanyblockthatlevel has]

  19. #9259
    QJ Gamer Blue
    Points: 4.008, Level: 40
    Level completed: 29%, Points required for next Level: 142
    Overall activity: 0%

    Registriert seit
    Dec 2007
    Ort
    dfgd
    Beiträge
    66
    Points
    4.008
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    i was going to let luke work it out for him self but then dan posted some crap so i thought i would correct it. im sure luke wont find it too hard to elaborate on what i have shown him now.
    I new what dan had put was wrong as soon as i read it lol and i new i needed listdirectory etc but i had no actual clue on how to get the name of files in a a directory and put them in a table then print that table to the screen, so the user can then select a save but you have shown me near enough how to do it so i have to create something that will let me choose a file aswell so thankyou for the example.

    PS: dan before you post something that your not too sure about try your idea thats what i do, if it dont work dont post and vice versa.

  20. #9260
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Don't worry i'm not gunna post in here any more, i can't be bothered arguing. (well unless i need help)
    Anyway back on topic, what does string.byte() do? this string function confuses me :S

  21. #9261
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Question

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    make a table:
    Code:
    levels = {}
    with some tables inside it:
    Code:
    levels = {{},{},{}}
    with some more tables inside them:
    Code:
    levels = {
    {{},{},{}},
    {{},{},{}},
    {{},{},{}}
    }
    The very inside tables are each a block. The tables a level above those are a "level" and the whole big table is all the levels. When you want to be on level 1, use levels[1][1]-levels[1][howevermanyblocksthatleve lhas]
    When you want level 5 use levels[5][1] to levels[5][howevermanyblockthatlevel has]
    I get the table. But would I call it by [1][1]to[1][24]
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  22. #9262
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    "But would I call it by [1][1]to[1][24]"
    If level one has 24 blocks, yes, and put all of those block tables within the first subtable of the whole big table.

    dan - use google, a simple "lua string.byte" returns two complete thorough explanations for the first and second results

  23. #9263
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    "But would I call it by [1][1]to[1][24]"
    If level one has 24 blocks, yes, and put all of those block tables within the first subtable of the whole big table.

    dan - use google, a simple "lua string.byte" returns two complete thorough explanations for the first and second results
    Thanks. Does this take alot of CPU, or as much as a Normal Table

    Edit: Also what about images would it be

    levels = { {{b1.x = 0,b1.y = 0,b1.img = image},{b2 blah blah}},
    {{b1.x = 0,b1.y = 0,b1.img = image},{b2 blah blah}} }
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  24. #9264
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    .....
    no. you're doing it wrong. why do you have b1.*, b2.*, etc? its being declared within the table so just do {x = whatever, y = whatever, img = whatever} for that one table and then to access it its levels[1][1].x levels[1][1].y etc

    and its just tables, its like grouped variables, theres no reason it would use more cpu and its not like arkanoid needs all the cpu it can get in the first place

  25. #9265
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    .....
    no. you're doing it wrong. why do you have b1.*, b2.*, etc? its being declared within the table so just do {x = whatever, y = whatever, img = whatever} for that one table and then to access it its levels[1][1].x levels[1][1].y etc

    and its just tables, its like grouped variables, theres no reason it would use more cpu and its not like arkanoid needs all the cpu it can get in the first place
    Ok I get it now Thanks
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  26. #9266
    QJ Gamer Green
    Points: 2.866, Level: 32
    Level completed: 78%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    6
    Points
    2.866
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    EDIT: NVM fixed it! And is there a way to make a count down timer? like something thats basically a egg timer... and is there a war to implement a way to stop a timer? like after a certain "code" is pressed in(Like cross, cross, triangle circle)

    Sorry for being such a newb haha, been searching for hours and i can't figure out how to make one.
    Geändert von psporpcp (08-17-2008 um 03:29 AM Uhr)

  27. #9267
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psporpcp Beitrag anzeigen
    EDIT: NVM fixed it! And is there a way to make a count down timer? like something thats basically a egg timer... and is there a war to implement a way to stop a timer? like after a certain "code" is pressed in(Like cross, cross, triangle circle)

    Sorry for being such a newb haha, been searching for hours and i can't figure out how to make one.
    You could just count up....



    Code:
    counter = Timer.new()
    
    counter:start()
    
    if pad:cross() then
    counter:stop()
    end
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  28. #9268
    QJ Gamer Green
    Points: 2.866, Level: 32
    Level completed: 78%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    6
    Points
    2.866
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von xXChromeXx Beitrag anzeigen
    You could just count up....



    Code:
    counter = Timer.new()
    
    counter:start()
    
    if pad:cross() then
    counter:stop()
    end
    Yea, thats what i have now, but i figured a countdown timer would be better because its going to be a timer for a airsoft "bomb planter" game xD

  29. #9269
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psporpcp Beitrag anzeigen
    Yea, thats what i have now, but i figured a countdown timer would be better because its going to be a timer for a airsoft "bomb planter" game xD
    You can use an up timer just as easily
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  30. #9270
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    You're failing to see that he wants to do a countDOWN timer to display to the user so that they run out of time counting down to zero.

    That can be done by using a normal counter counting up to the time they have and then when you print it out to show them how much time they have left use (totaltimetheyhave-timeonthetimer) to get countdowntimer


 

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

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