Seite 146 von 342 ErsteErste ... 46 96 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 196 246 ... LetzteLetzte
Zeige Ergebnis 4.351 bis 4.380 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; It will only work on the mod version, you should get an error, Unknown function or something like that....

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

    It will only work on the mod version, you should get an error, Unknown function or something like that.



  2. #4352
    QJ Gamer Bronze
    Points: 3.681, Level: 38
    Level completed: 21%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    30
    Points
    3.681
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I need to implement a simple highscore system in my game, but i don't know how i can do it. I have a idea in pseudocode :) the file must contain only one string :)

    Start of program
    -------------------------------

    high=read("high.txt")

    ---------------------------------

    function writescore()
    -----------------------------------
    if score>highscore then

    write score in "high.txt"
    high=read("high.txt")

    end if
    ---------------------------------
    thanks in advance

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

    Zitat Zitat von dsoft20
    I need to implement a simple highscore system in my game, but i don't know how i can do it. I have a idea in pseudocode :) the file must contain only one string :)

    Start of program
    -------------------------------

    high=read("high.txt")

    ---------------------------------

    function writescore()
    -----------------------------------
    if score>highscore then

    write score in "high.txt"
    high=read("high.txt")

    end if
    ---------------------------------
    thanks in advance
    high = io.open("high.txt","r")
    highscore = high:read()
    high:close()

    if score > highscore then
    high = io.open("high.txt","w")
    high:write(score)
    high:close()
    end

  4. #4354
    QJ Gamer Bronze
    Points: 3.681, Level: 38
    Level completed: 21%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    30
    Points
    3.681
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    high = io.open("high.txt","r")
    highscore = high:read()
    high:close()

    if score > highscore then
    high = io.open("high.txt","w")
    high:write(score)
    high:close()
    end
    Thanks you :Jump:

  5. #4355
    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

    pls can anyone help me?
    i want it, so when object1 is over the object2 and u press button, object2 will disappear...
    what should i use? whats best? collision or...?



    so the green one would disapper if i press button

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

    Code:
    function checkclick(object)
     if pad:cross() and (object1.x > object.x) and (object1.x < object.x + object.w) and (object1.y >  object.y) and (object1.y < object.y + object.h) then
      return true
     else
      return false
     end
    end
    checkclick(object2)
    if checkclick(object2) then
    --insert your method of getting rid of object 2 here
    end

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

    thx i will try it! :)

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

    Also, that method allows for object1 to simply be overtop of object2, they dont have to be perfectly lined up.

  9. #4359
    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

    yeh thats what im looking for

  10. #4360
    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 -TacticalPaper-
    Code:
    function checkclick(object)
     if pad:cross() and (object1.x > object.x) and (object1.x < object.x + object.w) and (object1.y >  object.y) and (object1.y < object.y + object.h) then
      return true
     else
      return false
     end
    end
    checkclick(object2)
    if checkclick(object2) then
    --insert your method of getting rid of object 2 here
    end

    thats perfect, but it will be more efficient to do this:



    Code:
    function checkclick(object)
     if (object1.x > object.x) and (object1.x < object.x + object.w) and (object1.y >  object.y) and (object1.y < object.y + object.h) then
      return true
     else
      return false
     end
    end
    
    if pad:cross() then 
       if checkclick(object2) then
            --insert your method of getting rid of object 2 here
       end
    end
    that way it doesnt check for collision when youre not pressing the button, saving you some speed.
    --------------------------------------------------------------------------------------

  11. #4361
    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 -TacticalPaper-
    Code:
    function checkclick(object)
     if pad:cross() and (object1.x > object.x) and (object1.x < object.x + object.w) and (object1.y >  object.y) and (object1.y < object.y + object.h) then
      return true
     else
      return false
     end
    end
    checkclick(object2)
    if checkclick(object2) then
    --insert your method of getting rid of object 2 here
    end
    that doesnt work you get this error
    Code:
    attempt to index global object <a nil value>
    -= Double Post =-
    a way you could do it instead of that way would be

    Code:
    function collisionCheck(object, object2)
    if (object2.x + object2.width > object.x) and (object2.x < object.x + object.width) and (object2.y + object2.height > object.y) and (object2.y < object.y + object.height) then
    return 1
    end
    end	
    while true do
    
    if pad:cross() and collisionCheck(Player, Enemy) then
    --what you want it to do
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    that way will work
    Geändert von the undead (11-27-2006 um 02:46 PM Uhr) Grund: Automerged Doublepost

  12. #4362
    I love the PS3!!!
    Points: 11.447, Level: 70
    Level completed: 50%, Points required for next Level: 203
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Look behind you
    Beiträge
    1.876
    Points
    11.447
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    My game is running kind of slow, I took out all looping functions that I could, took out everything that I could, and so now I am running out of ideas of what to get rid of... what else can i do? (I even set my psp to 333mhz but it still is slow)
    [size=-3][color=#fefefe]11[/color][color=white]0[/color][color=#fbfbfb]1[/color][color=#f1f4f6]0[/color][color=#f2f5f8]0[/color][color=#f7f8fa]1[/color][color=#fcfcfc]0[/color][color=#fdfefd]0[/color][color=#fffffe]1[/color][color=#fefefe]1[/color][color=white]1[/color][color=#fefefe]000[/color][color=white]1[/color][color=#fefefe]0[/color][color=white]0[/color][color=#fefefe]1111011[/color][color=white]1[/color][color=#fefefe]1[/color][color=white]101[/color]
    [color=white]1[/color][color=#fffefe]0[/color][color=#cad3e0]0[/color][color=#6f7f9c]1[/color][color=#788eaf]0[/color][color=#98b7d6]0[/color][color=#99c0e1]0[/color][color=#9ac2e2]1[/color][color=#a5c6e2]1[/color][color=#a6c3e2]0[/color][color=#b2bed1]1[/color][color=#dbe2ed]0[/color][color=#f7f9fa]1[/color][color=#fefefd]10110[/color][color=#fefefe]01[/color][color=#fefefd]0[/color][color=#fefefe]1[/color][color=#fefefd]10[/color][color=#fefefe]1[/color][color=white]00100[/color]
    [color=#fefefe]0[/color][color=#f2f6f8]0[/color][color=#566da3]0[/color][color=#8a919d]1[/color][color=#e2e5e4]0[/color][color=#eff2f3]0[/color][color=#eef2f6]1[/color][color=#e8eef3]1[/color][color=#dfe6ee]1[/color][color=#d1dee8]0[/color][color=#c1cddd]1[/color][color=#7997ce]1[/color][color=#8ea4d1]1[/color][color=#ebeeee]0[/color][color=#fdfef9]0[/color][color=#fefffa]1[/color][color=#fefefc]01101011[/color][color=#fefefd]1[/color][color=#fefefe]00[/color][color=white]10[/color][color=#fefefe]1[/color]
    [color=#fefefe]1[/color][color=#dde3ef]0[/color][color=#4866a7]1[/color][color=#b3bbc6]0[/color][color=#fafbf7]1[/color][color=#fefefc]0[/color][color=#f6f7f9]0[/color][color=#a8b6cf]1[/color][color=#6a7c9b]0[/color][color=#6886b2]0[/color][color=#7697c8]0[/color][color=#85a3cd]1[/color][color=#6287c3]1[/color][color=#496eb6]1[/color][color=#98abce]0[/color][color=#dde5e5]1[/color][color=#fcfef4]0[/color][color=#fdfef7]1[/color][color=#fefffa]100[/color][color=#fefefb]00[/color][color=#fefefc]00[/color][color=#fefefd]1[/color][color=#fefefe]1[/color][color=white]0[/color][color=#fefefe]0[/color][color=white]1[/color]
    [color=#fefefd]0[/color][color=#f8fafa]0[/color][color=#a7bce4]1[/color][color=#6887cf]0[/color][color=#9eb0d3]1[/color][color=#e3e9ec]1[/color][color=#bbc4d6]0[/color][color=#405b99]1[/color][color=#848b97]0[/color][color=#c2cace]0[/color][color=#c2cdd7]1[/color][color=#bdcce0]0[/color][color=#94acd4]1[/color][color=#547dc3]1[/color][color=#385ea9]1[/color][color=#496eb1]1[/color][color=#90a7c7]1[/color][color=#dde4e4]1[/color][color=#f6f9ee]1[/color][color=#fcfef3]1[/color][color=#fdfff5]1[/color][color=#fdfef7]1[/color][color=#fdfef8]0[/color][color=#fdfef9]1[/color][color=#fefefa]1[/color][color=#fefffb]1[/color][color=#fefefb]0[/color][color=#fefefc]1[/color][color=#fefefe]11[/color]
    [color=#fefefc]01[/color][color=#fcfdfc]0[/color][color=#e6ecf7]0[/color][color=#9fb5e7]0[/color][color=#6889cf]0[/color][color=#6b86c0]1[/color][color=#415ba1]0[/color][color=#6c82b0]0[/color][color=#d4d9da]0[/color][color=#f4f6ec]0[/color][color=#f8faf1]1[/color][color=#f5f8f3]0[/color][color=#e0e7ec]1[/color][color=#a0b7d8]1[/color][color=#5e82c2]0[/color][color=#2e5fb4]0[/color][color=#4065b0]1[/color][color=#809cc5]1[/color][color=#cdd7d9]1[/color][color=#f7f9e9]0[/color][color=#fafcef]1[/color][color=#fcfef2]1[/color][color=#fdfef5]1[/color][color=#fdfef6]1[/color][color=#fdfef9]0[/color][color=#fefff9]1[/color][color=#fefffa]1[/color][color=#fefefc]10[/color]
    [color=#fefefc]1100[/color][color=#fbfcfc]1[/color][color=#e8eff7]1[/color][color=#a5b8e6]1[/color][color=#5a7cc9]1[/color][color=#3a589d]0[/color][color=#3c5ba2]1[/color][color=#8d9fc1]1[/color][color=#d8deda]0[/color][color=#f4f7e8]0[/color][color=#f5f8ec]1[/color][color=#f1f5ea]0[/color][color=#dee5e4]1[/color][color=#b1c2d5]0[/color][color=#6b8dc7]1[/color][color=#416dba]1[/color][color=#3965b2]0[/color][color=#6c88b8]1[/color][color=#b5c3cd]0[/color][color=#e4e8df]1[/color][color=#f7f8e8]0[/color][color=#fbfdef]1[/color][color=#fcfef4]0[/color][color=#fdfff7]1[/color][color=#fefffa]0[/color][color=#fefefb]0[/color][color=#fefefc]1[/color]
    [color=#fefffb]1[/color][color=#fefefb]1[/color][color=#fefefc]0[/color][color=#fefffb]10[/color][color=#fdfefa]1[/color][color=#f9fbf9]0[/color][color=#dce4f1]1[/color][color=#94aada]1[/color][color=#4567b4]0[/color][color=#2c509f]0[/color][color=#4c6bac]0[/color][color=#a0adc3]1[/color][color=#e3e6db]0[/color][color=#f0f2e2]1[/color][color=#f0f3e4]0[/color][color=#ecf0e3]0[/color][color=#dde1dd]0[/color][color=#b1bfd1]0[/color][color=#7893bf]0[/color][color=#416fb7]0[/color][color=#3c66ad]0[/color][color=#6181b8]1[/color][color=#a3b2c8]1[/color][color=#dfe4de]1[/color][color=#f1f3e6]0[/color][color=#fafbf0]0[/color][color=#fcfdf6]1[/color][color=#fdfff8]1[/color][color=#fefffa]0[/color]
    [color=#fefffa]10[/color][color=#fefefa]1[/color][color=#fefffa]1[/color][color=#fefff9]11[/color][color=#fdfef8]1[/color][color=#fcfdf4]0[/color][color=#f5f7f3]0[/color][color=#d6dee9]1[/color][color=#809ad5]0[/color][color=#3a5cad]1[/color][color=#264a9f]1[/color][color=#4e6aad]1[/color][color=#a8b3c5]1[/color][color=#e2e4d5]1[/color][color=#ebecda]1[/color][color=#edeee0]0[/color][color=#e9ebde]0[/color][color=#dee1db]1[/color][color=#bfc7cd]1[/color][color=#869ec2]1[/color][color=#5479ba]1[/color][color=#3665b4]1[/color][color=#466aaf]0[/color][color=#7f95b9]1[/color][color=#c5ccd0]1[/color][color=#f2f3e6]0[/color][color=#f9faef]1[/color][color=#fcfef4]0[/color]
    [color=#fdfef7]10110[/color][color=#fdfef5]1[/color][color=#fdfdf2]1[/color][color=#fbfdf1]0[/color][color=#fbfcf0]0[/color][color=#f6f8ec]0[/color][color=#eaece8]0[/color][color=#c0cbdc]1[/color][color=#6e88c5]1[/color][color=#3657ab]0[/color][color=#2d4ea1]1[/color][color=#5b73ac]1[/color][color=#b1b9c1]1[/color][color=#dbdccf]0[/color][color=#e5e6d4]0[/color][color=#e6e7d7]0[/color][color=#e4e5da]0[/color][color=#d9ddd5]1[/color][color=#c1caca]0[/color][color=#99a9be]1[/color][color=#6584b9]1[/color][color=#4369b1]0[/color][color=#3f5fa1]0[/color][color=#7586a6]0[/color][color=#dcddd0]1[/color][color=#f4f4e7]1[/color]
    [color=#fcfdf1]01[/color][color=#fcfcf0]1[/color][color=#fcfcef]1[/color][color=#fcfcf0]1[/color][color=#fcfcef]0[/color][color=#fbfced]0[/color][color=#f9fbeb]1[/color][color=#f9faea]1[/color][color=#f7f8e7]0[/color][color=#f3f4e6]1[/color][color=#eeeee2]1[/color][color=#dbdfdb]0[/color][color=#a4b1ca]1[/color][color=#5670b4]1[/color][color=#284ca4]1[/color][color=#2e4e9a]0[/color][color=#6d80aa]1[/color][color=#bcc0bb]0[/color][color=#d9dbc9]1[/color][color=#dfe0ce]0[/color][color=#e2e3d2]0[/color][color=#dfe1d2]1[/color][color=#d7dbd0]1[/color][color=#c4cbc9]1[/color][color=#96a2b6]0[/color][color=#3c558e]0[/color][color=#56637f]0[/color][color=#d0d2c2]0[/color][color=#eae9db]0[/color]
    [color=#fafbec]1[/color][color=#f9faea]1000[/color][color=#f8f8e8]0[/color][color=#f7f7e6]1[/color][color=#f5f7e5]0[/color][color=#f5f5e3]0[/color][color=#f3f3e1]1[/color][color=#f1f1dd]0[/color][color=#eeeedc]0[/color][color=#ececda]0[/color][color=#e3e4d4]0[/color][color=#ced0c9]0[/color][color=#8e9db9]1[/color][color=#4766ac]0[/color][color=#234799]0[/color][color=#2e4c96]0[/color][color=#727d93]1[/color][color=#c1c2b1]0[/color][color=#d0d2c0]0[/color][color=#c1c6c1]1[/color][color=#9ba3b1]0[/color][color=#677591]0[/color][color=#415179]1[/color][color=#515d75]1[/color][color=#9fa29b]0[/color][color=#dbdacc]0[/color][color=#eceadb]0[/color]
    [color=#f6f5e5]10[/color][color=#f5f4e4]1[/color][color=#f5f5e3]01[/color][color=#f3f3e1]0[/color][color=#f3f2de]1[/color][color=#f2f1e0]0[/color][color=#f0efdc]0[/color][color=#efeed9]0[/color][color=#edecd8]0[/color][color=#ebebd6]1[/color][color=#e8e8d2]1[/color][color=#e3e2cd]0[/color][color=#e0dfcb]1[/color][color=#d6d6c6]1[/color][color=#b7bcbf]0[/color][color=#7a8cb0]1[/color][color=#4564a7]0[/color][color=#354d81]1[/color][color=#616b7f]0[/color][color=#57657f]1[/color][color=#445371]1[/color][color=#4f586b]1[/color][color=#6f7478]0[/color][color=#999b93]0[/color][color=#bdbeb0]1[/color][color=#d7d6c6]0[/color][color=#e5e3d3]1[/color][color=#eae9d8]0[/color]
    [color=#f1f0dd]0[/color][color=#f1efdc]0[/color][color=#f1f0e0]1[/color][color=#f0efdc]0[/color][color=#f0f0db]1[/color][color=#f0efd9]1[/color][color=#eeedd8]1[/color][color=#ededd7]1[/color][color=#ebebd4]0[/color][color=#eae9d3]0[/color][color=#e8e7d2]1[/color][color=#e6e6cf]0[/color][color=#e4e4cc]1[/color][color=#e2e2ca]1[/color][color=#e0dfca]0[/color][color=#dddcc6]0[/color][color=#d7d8c3]0[/color][color=#cdcfbd]1[/color][color=#adb1ac]1[/color][color=#868f95]1[/color][color=#777e7f]1[/color][color=#82867f]1[/color][color=#9d9e8f]1[/color][color=#b7b6a2]0[/color][color=#c6c6b0]1[/color][color=#d0d0ba]1[/color][color=#d7d6c3]0[/color][color=#dddcc9]0[/color][color=#e2e1ce]1[/color][color=#e5e4d1]0
    [/color][/size]
    [SIZE=1]a paper clip made by thekon[/SIZE]

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

    OPTIMIZATION! First of all, take all theimages you use that never even move and blit them to a buffer then blit the buffer. Thatll reduce the load from blitting less images.

  14. #4364
    I love the PS3!!!
    Points: 11.447, Level: 70
    Level completed: 50%, Points required for next Level: 203
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Look behind you
    Beiträge
    1.876
    Points
    11.447
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    well, most of my images are tiles, and they change... I only have 2 items that remain static.

    also, is it best to have all your images on one file, or multiple files?
    [size=-3][color=#fefefe]11[/color][color=white]0[/color][color=#fbfbfb]1[/color][color=#f1f4f6]0[/color][color=#f2f5f8]0[/color][color=#f7f8fa]1[/color][color=#fcfcfc]0[/color][color=#fdfefd]0[/color][color=#fffffe]1[/color][color=#fefefe]1[/color][color=white]1[/color][color=#fefefe]000[/color][color=white]1[/color][color=#fefefe]0[/color][color=white]0[/color][color=#fefefe]1111011[/color][color=white]1[/color][color=#fefefe]1[/color][color=white]101[/color]
    [color=white]1[/color][color=#fffefe]0[/color][color=#cad3e0]0[/color][color=#6f7f9c]1[/color][color=#788eaf]0[/color][color=#98b7d6]0[/color][color=#99c0e1]0[/color][color=#9ac2e2]1[/color][color=#a5c6e2]1[/color][color=#a6c3e2]0[/color][color=#b2bed1]1[/color][color=#dbe2ed]0[/color][color=#f7f9fa]1[/color][color=#fefefd]10110[/color][color=#fefefe]01[/color][color=#fefefd]0[/color][color=#fefefe]1[/color][color=#fefefd]10[/color][color=#fefefe]1[/color][color=white]00100[/color]
    [color=#fefefe]0[/color][color=#f2f6f8]0[/color][color=#566da3]0[/color][color=#8a919d]1[/color][color=#e2e5e4]0[/color][color=#eff2f3]0[/color][color=#eef2f6]1[/color][color=#e8eef3]1[/color][color=#dfe6ee]1[/color][color=#d1dee8]0[/color][color=#c1cddd]1[/color][color=#7997ce]1[/color][color=#8ea4d1]1[/color][color=#ebeeee]0[/color][color=#fdfef9]0[/color][color=#fefffa]1[/color][color=#fefefc]01101011[/color][color=#fefefd]1[/color][color=#fefefe]00[/color][color=white]10[/color][color=#fefefe]1[/color]
    [color=#fefefe]1[/color][color=#dde3ef]0[/color][color=#4866a7]1[/color][color=#b3bbc6]0[/color][color=#fafbf7]1[/color][color=#fefefc]0[/color][color=#f6f7f9]0[/color][color=#a8b6cf]1[/color][color=#6a7c9b]0[/color][color=#6886b2]0[/color][color=#7697c8]0[/color][color=#85a3cd]1[/color][color=#6287c3]1[/color][color=#496eb6]1[/color][color=#98abce]0[/color][color=#dde5e5]1[/color][color=#fcfef4]0[/color][color=#fdfef7]1[/color][color=#fefffa]100[/color][color=#fefefb]00[/color][color=#fefefc]00[/color][color=#fefefd]1[/color][color=#fefefe]1[/color][color=white]0[/color][color=#fefefe]0[/color][color=white]1[/color]
    [color=#fefefd]0[/color][color=#f8fafa]0[/color][color=#a7bce4]1[/color][color=#6887cf]0[/color][color=#9eb0d3]1[/color][color=#e3e9ec]1[/color][color=#bbc4d6]0[/color][color=#405b99]1[/color][color=#848b97]0[/color][color=#c2cace]0[/color][color=#c2cdd7]1[/color][color=#bdcce0]0[/color][color=#94acd4]1[/color][color=#547dc3]1[/color][color=#385ea9]1[/color][color=#496eb1]1[/color][color=#90a7c7]1[/color][color=#dde4e4]1[/color][color=#f6f9ee]1[/color][color=#fcfef3]1[/color][color=#fdfff5]1[/color][color=#fdfef7]1[/color][color=#fdfef8]0[/color][color=#fdfef9]1[/color][color=#fefefa]1[/color][color=#fefffb]1[/color][color=#fefefb]0[/color][color=#fefefc]1[/color][color=#fefefe]11[/color]
    [color=#fefefc]01[/color][color=#fcfdfc]0[/color][color=#e6ecf7]0[/color][color=#9fb5e7]0[/color][color=#6889cf]0[/color][color=#6b86c0]1[/color][color=#415ba1]0[/color][color=#6c82b0]0[/color][color=#d4d9da]0[/color][color=#f4f6ec]0[/color][color=#f8faf1]1[/color][color=#f5f8f3]0[/color][color=#e0e7ec]1[/color][color=#a0b7d8]1[/color][color=#5e82c2]0[/color][color=#2e5fb4]0[/color][color=#4065b0]1[/color][color=#809cc5]1[/color][color=#cdd7d9]1[/color][color=#f7f9e9]0[/color][color=#fafcef]1[/color][color=#fcfef2]1[/color][color=#fdfef5]1[/color][color=#fdfef6]1[/color][color=#fdfef9]0[/color][color=#fefff9]1[/color][color=#fefffa]1[/color][color=#fefefc]10[/color]
    [color=#fefefc]1100[/color][color=#fbfcfc]1[/color][color=#e8eff7]1[/color][color=#a5b8e6]1[/color][color=#5a7cc9]1[/color][color=#3a589d]0[/color][color=#3c5ba2]1[/color][color=#8d9fc1]1[/color][color=#d8deda]0[/color][color=#f4f7e8]0[/color][color=#f5f8ec]1[/color][color=#f1f5ea]0[/color][color=#dee5e4]1[/color][color=#b1c2d5]0[/color][color=#6b8dc7]1[/color][color=#416dba]1[/color][color=#3965b2]0[/color][color=#6c88b8]1[/color][color=#b5c3cd]0[/color][color=#e4e8df]1[/color][color=#f7f8e8]0[/color][color=#fbfdef]1[/color][color=#fcfef4]0[/color][color=#fdfff7]1[/color][color=#fefffa]0[/color][color=#fefefb]0[/color][color=#fefefc]1[/color]
    [color=#fefffb]1[/color][color=#fefefb]1[/color][color=#fefefc]0[/color][color=#fefffb]10[/color][color=#fdfefa]1[/color][color=#f9fbf9]0[/color][color=#dce4f1]1[/color][color=#94aada]1[/color][color=#4567b4]0[/color][color=#2c509f]0[/color][color=#4c6bac]0[/color][color=#a0adc3]1[/color][color=#e3e6db]0[/color][color=#f0f2e2]1[/color][color=#f0f3e4]0[/color][color=#ecf0e3]0[/color][color=#dde1dd]0[/color][color=#b1bfd1]0[/color][color=#7893bf]0[/color][color=#416fb7]0[/color][color=#3c66ad]0[/color][color=#6181b8]1[/color][color=#a3b2c8]1[/color][color=#dfe4de]1[/color][color=#f1f3e6]0[/color][color=#fafbf0]0[/color][color=#fcfdf6]1[/color][color=#fdfff8]1[/color][color=#fefffa]0[/color]
    [color=#fefffa]10[/color][color=#fefefa]1[/color][color=#fefffa]1[/color][color=#fefff9]11[/color][color=#fdfef8]1[/color][color=#fcfdf4]0[/color][color=#f5f7f3]0[/color][color=#d6dee9]1[/color][color=#809ad5]0[/color][color=#3a5cad]1[/color][color=#264a9f]1[/color][color=#4e6aad]1[/color][color=#a8b3c5]1[/color][color=#e2e4d5]1[/color][color=#ebecda]1[/color][color=#edeee0]0[/color][color=#e9ebde]0[/color][color=#dee1db]1[/color][color=#bfc7cd]1[/color][color=#869ec2]1[/color][color=#5479ba]1[/color][color=#3665b4]1[/color][color=#466aaf]0[/color][color=#7f95b9]1[/color][color=#c5ccd0]1[/color][color=#f2f3e6]0[/color][color=#f9faef]1[/color][color=#fcfef4]0[/color]
    [color=#fdfef7]10110[/color][color=#fdfef5]1[/color][color=#fdfdf2]1[/color][color=#fbfdf1]0[/color][color=#fbfcf0]0[/color][color=#f6f8ec]0[/color][color=#eaece8]0[/color][color=#c0cbdc]1[/color][color=#6e88c5]1[/color][color=#3657ab]0[/color][color=#2d4ea1]1[/color][color=#5b73ac]1[/color][color=#b1b9c1]1[/color][color=#dbdccf]0[/color][color=#e5e6d4]0[/color][color=#e6e7d7]0[/color][color=#e4e5da]0[/color][color=#d9ddd5]1[/color][color=#c1caca]0[/color][color=#99a9be]1[/color][color=#6584b9]1[/color][color=#4369b1]0[/color][color=#3f5fa1]0[/color][color=#7586a6]0[/color][color=#dcddd0]1[/color][color=#f4f4e7]1[/color]
    [color=#fcfdf1]01[/color][color=#fcfcf0]1[/color][color=#fcfcef]1[/color][color=#fcfcf0]1[/color][color=#fcfcef]0[/color][color=#fbfced]0[/color][color=#f9fbeb]1[/color][color=#f9faea]1[/color][color=#f7f8e7]0[/color][color=#f3f4e6]1[/color][color=#eeeee2]1[/color][color=#dbdfdb]0[/color][color=#a4b1ca]1[/color][color=#5670b4]1[/color][color=#284ca4]1[/color][color=#2e4e9a]0[/color][color=#6d80aa]1[/color][color=#bcc0bb]0[/color][color=#d9dbc9]1[/color][color=#dfe0ce]0[/color][color=#e2e3d2]0[/color][color=#dfe1d2]1[/color][color=#d7dbd0]1[/color][color=#c4cbc9]1[/color][color=#96a2b6]0[/color][color=#3c558e]0[/color][color=#56637f]0[/color][color=#d0d2c2]0[/color][color=#eae9db]0[/color]
    [color=#fafbec]1[/color][color=#f9faea]1000[/color][color=#f8f8e8]0[/color][color=#f7f7e6]1[/color][color=#f5f7e5]0[/color][color=#f5f5e3]0[/color][color=#f3f3e1]1[/color][color=#f1f1dd]0[/color][color=#eeeedc]0[/color][color=#ececda]0[/color][color=#e3e4d4]0[/color][color=#ced0c9]0[/color][color=#8e9db9]1[/color][color=#4766ac]0[/color][color=#234799]0[/color][color=#2e4c96]0[/color][color=#727d93]1[/color][color=#c1c2b1]0[/color][color=#d0d2c0]0[/color][color=#c1c6c1]1[/color][color=#9ba3b1]0[/color][color=#677591]0[/color][color=#415179]1[/color][color=#515d75]1[/color][color=#9fa29b]0[/color][color=#dbdacc]0[/color][color=#eceadb]0[/color]
    [color=#f6f5e5]10[/color][color=#f5f4e4]1[/color][color=#f5f5e3]01[/color][color=#f3f3e1]0[/color][color=#f3f2de]1[/color][color=#f2f1e0]0[/color][color=#f0efdc]0[/color][color=#efeed9]0[/color][color=#edecd8]0[/color][color=#ebebd6]1[/color][color=#e8e8d2]1[/color][color=#e3e2cd]0[/color][color=#e0dfcb]1[/color][color=#d6d6c6]1[/color][color=#b7bcbf]0[/color][color=#7a8cb0]1[/color][color=#4564a7]0[/color][color=#354d81]1[/color][color=#616b7f]0[/color][color=#57657f]1[/color][color=#445371]1[/color][color=#4f586b]1[/color][color=#6f7478]0[/color][color=#999b93]0[/color][color=#bdbeb0]1[/color][color=#d7d6c6]0[/color][color=#e5e3d3]1[/color][color=#eae9d8]0[/color]
    [color=#f1f0dd]0[/color][color=#f1efdc]0[/color][color=#f1f0e0]1[/color][color=#f0efdc]0[/color][color=#f0f0db]1[/color][color=#f0efd9]1[/color][color=#eeedd8]1[/color][color=#ededd7]1[/color][color=#ebebd4]0[/color][color=#eae9d3]0[/color][color=#e8e7d2]1[/color][color=#e6e6cf]0[/color][color=#e4e4cc]1[/color][color=#e2e2ca]1[/color][color=#e0dfca]0[/color][color=#dddcc6]0[/color][color=#d7d8c3]0[/color][color=#cdcfbd]1[/color][color=#adb1ac]1[/color][color=#868f95]1[/color][color=#777e7f]1[/color][color=#82867f]1[/color][color=#9d9e8f]1[/color][color=#b7b6a2]0[/color][color=#c6c6b0]1[/color][color=#d0d0ba]1[/color][color=#d7d6c3]0[/color][color=#dddcc9]0[/color][color=#e2e1ce]1[/color][color=#e5e4d1]0
    [/color][/size]
    [SIZE=1]a paper clip made by thekon[/SIZE]

  15. #4365
    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

    maybe after you blit the image's you could make them nil?

  16. #4366
    I love the PS3!!!
    Points: 11.447, Level: 70
    Level completed: 50%, Points required for next Level: 203
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Look behind you
    Beiträge
    1.876
    Points
    11.447
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    I downsized some of my image files (had some transparencies that I could crop) and now it works a little bit better. should i have alpha on or off for images?
    [size=-3][color=#fefefe]11[/color][color=white]0[/color][color=#fbfbfb]1[/color][color=#f1f4f6]0[/color][color=#f2f5f8]0[/color][color=#f7f8fa]1[/color][color=#fcfcfc]0[/color][color=#fdfefd]0[/color][color=#fffffe]1[/color][color=#fefefe]1[/color][color=white]1[/color][color=#fefefe]000[/color][color=white]1[/color][color=#fefefe]0[/color][color=white]0[/color][color=#fefefe]1111011[/color][color=white]1[/color][color=#fefefe]1[/color][color=white]101[/color]
    [color=white]1[/color][color=#fffefe]0[/color][color=#cad3e0]0[/color][color=#6f7f9c]1[/color][color=#788eaf]0[/color][color=#98b7d6]0[/color][color=#99c0e1]0[/color][color=#9ac2e2]1[/color][color=#a5c6e2]1[/color][color=#a6c3e2]0[/color][color=#b2bed1]1[/color][color=#dbe2ed]0[/color][color=#f7f9fa]1[/color][color=#fefefd]10110[/color][color=#fefefe]01[/color][color=#fefefd]0[/color][color=#fefefe]1[/color][color=#fefefd]10[/color][color=#fefefe]1[/color][color=white]00100[/color]
    [color=#fefefe]0[/color][color=#f2f6f8]0[/color][color=#566da3]0[/color][color=#8a919d]1[/color][color=#e2e5e4]0[/color][color=#eff2f3]0[/color][color=#eef2f6]1[/color][color=#e8eef3]1[/color][color=#dfe6ee]1[/color][color=#d1dee8]0[/color][color=#c1cddd]1[/color][color=#7997ce]1[/color][color=#8ea4d1]1[/color][color=#ebeeee]0[/color][color=#fdfef9]0[/color][color=#fefffa]1[/color][color=#fefefc]01101011[/color][color=#fefefd]1[/color][color=#fefefe]00[/color][color=white]10[/color][color=#fefefe]1[/color]
    [color=#fefefe]1[/color][color=#dde3ef]0[/color][color=#4866a7]1[/color][color=#b3bbc6]0[/color][color=#fafbf7]1[/color][color=#fefefc]0[/color][color=#f6f7f9]0[/color][color=#a8b6cf]1[/color][color=#6a7c9b]0[/color][color=#6886b2]0[/color][color=#7697c8]0[/color][color=#85a3cd]1[/color][color=#6287c3]1[/color][color=#496eb6]1[/color][color=#98abce]0[/color][color=#dde5e5]1[/color][color=#fcfef4]0[/color][color=#fdfef7]1[/color][color=#fefffa]100[/color][color=#fefefb]00[/color][color=#fefefc]00[/color][color=#fefefd]1[/color][color=#fefefe]1[/color][color=white]0[/color][color=#fefefe]0[/color][color=white]1[/color]
    [color=#fefefd]0[/color][color=#f8fafa]0[/color][color=#a7bce4]1[/color][color=#6887cf]0[/color][color=#9eb0d3]1[/color][color=#e3e9ec]1[/color][color=#bbc4d6]0[/color][color=#405b99]1[/color][color=#848b97]0[/color][color=#c2cace]0[/color][color=#c2cdd7]1[/color][color=#bdcce0]0[/color][color=#94acd4]1[/color][color=#547dc3]1[/color][color=#385ea9]1[/color][color=#496eb1]1[/color][color=#90a7c7]1[/color][color=#dde4e4]1[/color][color=#f6f9ee]1[/color][color=#fcfef3]1[/color][color=#fdfff5]1[/color][color=#fdfef7]1[/color][color=#fdfef8]0[/color][color=#fdfef9]1[/color][color=#fefefa]1[/color][color=#fefffb]1[/color][color=#fefefb]0[/color][color=#fefefc]1[/color][color=#fefefe]11[/color]
    [color=#fefefc]01[/color][color=#fcfdfc]0[/color][color=#e6ecf7]0[/color][color=#9fb5e7]0[/color][color=#6889cf]0[/color][color=#6b86c0]1[/color][color=#415ba1]0[/color][color=#6c82b0]0[/color][color=#d4d9da]0[/color][color=#f4f6ec]0[/color][color=#f8faf1]1[/color][color=#f5f8f3]0[/color][color=#e0e7ec]1[/color][color=#a0b7d8]1[/color][color=#5e82c2]0[/color][color=#2e5fb4]0[/color][color=#4065b0]1[/color][color=#809cc5]1[/color][color=#cdd7d9]1[/color][color=#f7f9e9]0[/color][color=#fafcef]1[/color][color=#fcfef2]1[/color][color=#fdfef5]1[/color][color=#fdfef6]1[/color][color=#fdfef9]0[/color][color=#fefff9]1[/color][color=#fefffa]1[/color][color=#fefefc]10[/color]
    [color=#fefefc]1100[/color][color=#fbfcfc]1[/color][color=#e8eff7]1[/color][color=#a5b8e6]1[/color][color=#5a7cc9]1[/color][color=#3a589d]0[/color][color=#3c5ba2]1[/color][color=#8d9fc1]1[/color][color=#d8deda]0[/color][color=#f4f7e8]0[/color][color=#f5f8ec]1[/color][color=#f1f5ea]0[/color][color=#dee5e4]1[/color][color=#b1c2d5]0[/color][color=#6b8dc7]1[/color][color=#416dba]1[/color][color=#3965b2]0[/color][color=#6c88b8]1[/color][color=#b5c3cd]0[/color][color=#e4e8df]1[/color][color=#f7f8e8]0[/color][color=#fbfdef]1[/color][color=#fcfef4]0[/color][color=#fdfff7]1[/color][color=#fefffa]0[/color][color=#fefefb]0[/color][color=#fefefc]1[/color]
    [color=#fefffb]1[/color][color=#fefefb]1[/color][color=#fefefc]0[/color][color=#fefffb]10[/color][color=#fdfefa]1[/color][color=#f9fbf9]0[/color][color=#dce4f1]1[/color][color=#94aada]1[/color][color=#4567b4]0[/color][color=#2c509f]0[/color][color=#4c6bac]0[/color][color=#a0adc3]1[/color][color=#e3e6db]0[/color][color=#f0f2e2]1[/color][color=#f0f3e4]0[/color][color=#ecf0e3]0[/color][color=#dde1dd]0[/color][color=#b1bfd1]0[/color][color=#7893bf]0[/color][color=#416fb7]0[/color][color=#3c66ad]0[/color][color=#6181b8]1[/color][color=#a3b2c8]1[/color][color=#dfe4de]1[/color][color=#f1f3e6]0[/color][color=#fafbf0]0[/color][color=#fcfdf6]1[/color][color=#fdfff8]1[/color][color=#fefffa]0[/color]
    [color=#fefffa]10[/color][color=#fefefa]1[/color][color=#fefffa]1[/color][color=#fefff9]11[/color][color=#fdfef8]1[/color][color=#fcfdf4]0[/color][color=#f5f7f3]0[/color][color=#d6dee9]1[/color][color=#809ad5]0[/color][color=#3a5cad]1[/color][color=#264a9f]1[/color][color=#4e6aad]1[/color][color=#a8b3c5]1[/color][color=#e2e4d5]1[/color][color=#ebecda]1[/color][color=#edeee0]0[/color][color=#e9ebde]0[/color][color=#dee1db]1[/color][color=#bfc7cd]1[/color][color=#869ec2]1[/color][color=#5479ba]1[/color][color=#3665b4]1[/color][color=#466aaf]0[/color][color=#7f95b9]1[/color][color=#c5ccd0]1[/color][color=#f2f3e6]0[/color][color=#f9faef]1[/color][color=#fcfef4]0[/color]
    [color=#fdfef7]10110[/color][color=#fdfef5]1[/color][color=#fdfdf2]1[/color][color=#fbfdf1]0[/color][color=#fbfcf0]0[/color][color=#f6f8ec]0[/color][color=#eaece8]0[/color][color=#c0cbdc]1[/color][color=#6e88c5]1[/color][color=#3657ab]0[/color][color=#2d4ea1]1[/color][color=#5b73ac]1[/color][color=#b1b9c1]1[/color][color=#dbdccf]0[/color][color=#e5e6d4]0[/color][color=#e6e7d7]0[/color][color=#e4e5da]0[/color][color=#d9ddd5]1[/color][color=#c1caca]0[/color][color=#99a9be]1[/color][color=#6584b9]1[/color][color=#4369b1]0[/color][color=#3f5fa1]0[/color][color=#7586a6]0[/color][color=#dcddd0]1[/color][color=#f4f4e7]1[/color]
    [color=#fcfdf1]01[/color][color=#fcfcf0]1[/color][color=#fcfcef]1[/color][color=#fcfcf0]1[/color][color=#fcfcef]0[/color][color=#fbfced]0[/color][color=#f9fbeb]1[/color][color=#f9faea]1[/color][color=#f7f8e7]0[/color][color=#f3f4e6]1[/color][color=#eeeee2]1[/color][color=#dbdfdb]0[/color][color=#a4b1ca]1[/color][color=#5670b4]1[/color][color=#284ca4]1[/color][color=#2e4e9a]0[/color][color=#6d80aa]1[/color][color=#bcc0bb]0[/color][color=#d9dbc9]1[/color][color=#dfe0ce]0[/color][color=#e2e3d2]0[/color][color=#dfe1d2]1[/color][color=#d7dbd0]1[/color][color=#c4cbc9]1[/color][color=#96a2b6]0[/color][color=#3c558e]0[/color][color=#56637f]0[/color][color=#d0d2c2]0[/color][color=#eae9db]0[/color]
    [color=#fafbec]1[/color][color=#f9faea]1000[/color][color=#f8f8e8]0[/color][color=#f7f7e6]1[/color][color=#f5f7e5]0[/color][color=#f5f5e3]0[/color][color=#f3f3e1]1[/color][color=#f1f1dd]0[/color][color=#eeeedc]0[/color][color=#ececda]0[/color][color=#e3e4d4]0[/color][color=#ced0c9]0[/color][color=#8e9db9]1[/color][color=#4766ac]0[/color][color=#234799]0[/color][color=#2e4c96]0[/color][color=#727d93]1[/color][color=#c1c2b1]0[/color][color=#d0d2c0]0[/color][color=#c1c6c1]1[/color][color=#9ba3b1]0[/color][color=#677591]0[/color][color=#415179]1[/color][color=#515d75]1[/color][color=#9fa29b]0[/color][color=#dbdacc]0[/color][color=#eceadb]0[/color]
    [color=#f6f5e5]10[/color][color=#f5f4e4]1[/color][color=#f5f5e3]01[/color][color=#f3f3e1]0[/color][color=#f3f2de]1[/color][color=#f2f1e0]0[/color][color=#f0efdc]0[/color][color=#efeed9]0[/color][color=#edecd8]0[/color][color=#ebebd6]1[/color][color=#e8e8d2]1[/color][color=#e3e2cd]0[/color][color=#e0dfcb]1[/color][color=#d6d6c6]1[/color][color=#b7bcbf]0[/color][color=#7a8cb0]1[/color][color=#4564a7]0[/color][color=#354d81]1[/color][color=#616b7f]0[/color][color=#57657f]1[/color][color=#445371]1[/color][color=#4f586b]1[/color][color=#6f7478]0[/color][color=#999b93]0[/color][color=#bdbeb0]1[/color][color=#d7d6c6]0[/color][color=#e5e3d3]1[/color][color=#eae9d8]0[/color]
    [color=#f1f0dd]0[/color][color=#f1efdc]0[/color][color=#f1f0e0]1[/color][color=#f0efdc]0[/color][color=#f0f0db]1[/color][color=#f0efd9]1[/color][color=#eeedd8]1[/color][color=#ededd7]1[/color][color=#ebebd4]0[/color][color=#eae9d3]0[/color][color=#e8e7d2]1[/color][color=#e6e6cf]0[/color][color=#e4e4cc]1[/color][color=#e2e2ca]1[/color][color=#e0dfca]0[/color][color=#dddcc6]0[/color][color=#d7d8c3]0[/color][color=#cdcfbd]1[/color][color=#adb1ac]1[/color][color=#868f95]1[/color][color=#777e7f]1[/color][color=#82867f]1[/color][color=#9d9e8f]1[/color][color=#b7b6a2]0[/color][color=#c6c6b0]1[/color][color=#d0d0ba]1[/color][color=#d7d6c3]0[/color][color=#dddcc9]0[/color][color=#e2e1ce]1[/color][color=#e5e4d1]0
    [/color][/size]
    [SIZE=1]a paper clip made by thekon[/SIZE]

  17. #4367
    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

    Iff the image has transparency in it, dont specify alpha. If it has no transparency, specify false.

  18. #4368
    I love the PS3!!!
    Points: 11.447, Level: 70
    Level completed: 50%, Points required for next Level: 203
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Look behind you
    Beiträge
    1.876
    Points
    11.447
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    will that speed anything up?
    -= Double Post =-
    Ill post some of my code (this is the code without the full AI, but it still runs slow)... the AI takes up some more room (400 more lines) so I just took out the bulk of it but there may still be some in there... I dont know if you can help me or not (mainly since who wants to read over a thousand lines of code?)

    you might recognize this as Lumo's bomberman beta (some of his comments are still in there), he gave me permission to take it and make a full game out of it. Im going to go rewrite most of it, but first I need to get to the bottom of what is making my code so bad. just tell me what you think I could do to make it run faster...

    Spoiler for Dracule's code:

    freemovement=false

    style = "ice"
    Level={background="bg_fie ld2.png"}

    if style=="" or style=="default" then
    gfxstyle = "gfx_park_tiles.png"
    else
    gfxstyle = "gfx".."_"..style.."_tile s.png"
    file = io.open(gfxstyle, "r")
    io.close() -- cleanup
    if not file then
    gfxstyle="gfx_park_tiles. png"
    end
    end
    dropage=true


    images={
    gfx_bombs = Image.load("gfx_bombs.png "), --192x32
    gfx_tiles = Image.load(gfxstyle),
    tiles = Image.load("tiles.png"),
    gfx_p1 = Image.load("gfx_p1.png"),
    gfx_p2 = Image.load("gfx_p2.png"),
    level_border = Image.load("pow.png")
    }

    snd_explode = Sound.load('snd_explode.w av', false)
    snd_laybomb = Sound.load('snd_laybomb.w av', false)


    layer = {
    background = Image.load(Level.backgrou nd),
    map = Image.createEmpty(480, 272),
    backpuffer = Image.createEmpty(480, 272),
    explode = Image.createEmpty(480, 272)
    }


    maxSpeed = 10
    score = 0
    high = 0
    movement = {p1={dx=0,dy=0,speedx=1,s peedy=1},p2={dx=0,dy=0,sp eedx=1,speedy=1}}

    framecount = 0
    singleplayer = false

    gameOver = 'false'



    down = 1
    up = 2
    right = 3
    left = 4

    check_coordinates = {
    {{0, 16},{16,16}},
    {{0, 0}, {16,0}},
    {{16, 0}, {16,16}},
    {{0, 0}, {0, 16}}
    }
    check_tiles = {
    {0, 1},
    {0, -1},
    {1, 0},
    {-1,0}
    }


    tile = {
    grass = { x = 0, y = 0, cycle=8 },
    solid = { x = 16, y = 0, cycle=8 },
    wall = { x = 48, y = 0, cycle=8 },
    breakingWall = {x=0,y=0,cycle=8},
    bomb = { x = 0, y = 0, cycle=8 },
    lawn = { x = 32, y = 0, cycle=8 },
    bombexplode = { x = 0, y = 16, cycle=8 },
    }
    tile_p1_down = { x = 0, y = down*24-24, cycle=8 }
    tile_p1_up = { x = 0, y = up*24-24, cycle=8 }
    tile_p1_right = { x = 0, y = right*24-24, cycle=8 }
    tile_p1_left = { x = 0, y = left*24-24, cycle=8 }

    tile_p2_down = { x = 0, y = down*24-24, cycle=8 }
    tile_p2_up = { x = 0, y = up*24-24, cycle=8 }
    tile_p2_right = { x = 0, y = right*24-24, cycle=8 }
    tile_p2_left = { x = 0, y = left*24-24, cycle=8 }

    tile_p1 = {tile_p1_down, tile_p1_up, tile_p1_right, tile_p1_left}
    tile_p2 = {tile_p2_down, tile_p2_up, tile_p2_right, tile_p2_left}

    Level ={
    x=8,
    y=24,
    usebackground=false,
    background="pow.png",
    style = "ice",
    data= {
    {0,0,0,2,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1 ,1,1,1,1},
    {0,0,0,2,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,2,0,0,0,0,0,0,0,3, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {2,2,0,2,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,3,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,1,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,0,1,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,1,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,1,1,0,0,0,0,0,0,0,0 ,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0, 0,1,1,1,1,0,0,0,0,0,0,0,0 ,0,0,0,0}
    }
    }

    Startpos = {
    p1 = {x=1,y=1},
    p2 = {x=29,y=15}
    }

    LEVEL_TYPE = 'TIME'


    GameType = {
    TimePoints = {title='TimePoints', time=2, value=0 }, --in minutes
    TimeKills = {title='TimeKills', time=2, value=0 }, --in minutes
    Points = {title='Points', time=0, value=10},
    Kills = {title='Kills', time=0, value=10}
    }

    player = {
    p1={
    x=Level.x+Startpos.p1.x*1 6-16, --the pos where the image starts --+8,+21 <-- the pos where bomberman actually stands
    y=-14+Startpos.p1.y*16-16,
    posx = Level.x+Startpos.p2.x*16-16,
    posy = -14+Startpos.p2.x*16-16,
    direction=down,
    lastdirection=down,
    speed=5,
    tilex=Startpos.p1.x,
    tiley=Startpos.p1.y,
    flamelength=3,
    hasbombs=3,
    bombs={
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 }},
    visible=true,
    undestroyable=false,
    kills=0,
    deaths=0,
    suicide=0,
    freeze=0
    },
    p2={
    x=Level.x+28*16, --the pos where the image starts --+8,+21 <-- the pos where bomberman actually stands
    y=Level.y+13*16-22,
    posx = Level.x+Startpos.p2.x*16-16,
    posy = -14+Startpos.p2.x*16-16,
    direction=up,
    lastdirection=up,
    speed=5,
    tilex=Startpos.p2.x,
    tiley=Startpos.p2.y,
    flamelength=3,
    hasbombs=3,
    bombs={
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },{time=60,x=0,y=0,active =false,placed=false,frame =0},

    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 },
    {time=60,x=0,y=0,active=f alse,placed=false,frame=0 }},
    visible=true,
    undestroyable=false,
    kills=0,
    deaths=0,
    suicide=0,
    freeze=0
    }

    }

    highscoreFile = "highscore.txt"

    function transposeMatrix(matrix)
    newMatrix = {}
    for i = 1,table.getn(matrix[1]) do --1..17
    table.insert( newMatrix, {} ) --adds a line
    for j = 1,table.getn(matrix) do --1..17
    table.insert( newMatrix[i], matrix[j][i] ) --change i|j
    end
    end
    return newMatrix
    end

    function drawMap()
    layer.map:clear()
    for i=0,table.getn(Level.data )-1 do --15lines
    for j=0,table.getn(Level.data[1])-1 do --29tiles
    if Level.data[i+1][j+1]<0 then --empty; -1 = kill
    --layer.map:fillRect(Level. x+i*16, Level.y+j*16, 16, 16, Color.new(0,0,255))
    elseif Level.data[i+1][j+1]==0 then --empty; -1 = kill
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.grass.x, 0, 16, 16, true)
    elseif Level.data[i+1][j+1] == 1 then--solid
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.grass.x, 0, 16, 16, true)
    -- wall may have some trans-parts so draw the floor below
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.solid.x, 0, 16, 16, true)
    elseif Level.data[i+1][j+1] == 2 then--wall
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.grass.x, 0, 16, 16, true)
    -- wall may have some trans-parts so draw the floor below
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.wall.x, 0, 16, 16, true)
    elseif Level.data[i+1][j+1] == 3 then
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.grass.x, 0, 16, 16, true)
    -- wall may have some trans-parts so draw the floor below
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.lawn.x, 0, 16, 16, true)
    else --sprite or player
    layer.map:blit(Level.x+i* 16, Level.y+j*16, images.tiles, tile.grass.x, 0, 16, 16, true)
    --sprites
    end
    end
    end
    if not Level.usebackground then
    layer.map:blit(0, 0, images.level_border, 0, 0, images.level_border:width (), images.level_border:heigh t(), true)
    end
    end


    function drawStats()
    screen:blit(2,2, images.gfx_p1, 0, 0, 16, 12, true)
    screenrint(25,4,'D:'..player.p1 .deaths..' S:'..player.p1.suicide..' K:'..player.p1.kills,Colo r.new(255,0,0))

    screen:blit(462,2, images.gfx_p2, 0, 0, 16, 12, true)
    screenrint(370,4,'D:'..player.p 2.deaths..' S:'..player.p2.suicide..' K:'..player.p2.kills,Colo r.new(255,0,0))

    end


    function drawSprites()
    drawBombs()
    drawBreakingWall()
    end


    function drawBreakingWall()
    for i=0,table.getn(Level.data )-1 do --15 tiles
    for j=0,table.getn(Level.data[1])-1 do --17 tiles
    if Level.data[i+1][j+1] >= 100 then--wall-breaking
    curframe=Level.data[i+1][j+1]

    layer.backpuffer:blit(Lev el.x+i*16, Level.y+j*16, images.gfx_tiles, tile.breakingWall.x+math. mod(curframe,10)*16,

    tile.breakingWall.y, 16, 16, true)

    if curframe<108 then
    Level.data[i+1][j+1]=curframe+1
    else
    Level.data[i+1][j+1]=3 --its an empty block now
    end
    end
    end
    end
    end


    function drawPlayers()

    if player.p1.move and player.p1.visible then
    layer.backpuffer:blit(pla yer.p1.x, Level.y+player.p1.y, images.gfx_p1, tile_p1[player.p1.direction].x+math.mod(framecount,ti le_p1

    [player.p1.direction].cycle)*16, tile_p1[player.p1.direction].y, 16, 24, true)
    elseif player.p1.visible then --show it standing
    layer.backpuffer:blit(pla yer.p1.x, Level.y+player.p1.y, images.gfx_p1, tile_p1[player.p1.direction].x, tile_p1[player.p1.direction].y, 16,

    24, true)
    end
    if not singleplayer then
    if player.p2.move and player.p2.visible then
    layer.backpuffer:blit(pla yer.p2.x, Level.y+player.p2.y, images.gfx_p2, tile_p2[player.p2.direction].x+math.mod(framecount,ti le_p2

    [player.p2.direction].cycle)*16, tile_p2[player.p2.direction].y, 16, 24, true)
    elseif player.p2.visible then --show it standing
    layer.backpuffer:blit(pla yer.p2.x, Level.y+player.p2.y, images.gfx_p2, tile_p2[player.p2.direction].x, tile_p2

    [player.p2.direction].y, 16, 24, true)
    end
    end
    end

    function getBombCount(local_player )
    count=0
    for i=1,10 do

    if local_player.bombs[i].placed then
    count=count+1
    end
    end
    return count
    end


    function playerDropBomb(local_play er)

    bombx=local_player.tilex
    bomby=local_player.tiley
    addednewbomb = false
    if (local_player.hasbombs > getBombCount(local_player )) and (Level.data[bombx][bomby]==0 or Level.data[bombx][bomby]==3) then -- player has more

    bombs than already on field
    snd_laybomblay()

    for i=1,local_player.hasbombs do
    if (not local_player.bombs[i].placed) and (not addednewbomb) then --and (not local_player.bombs[i].active) and (not addednewbomb)

    then

    Level.data[bombx][bomby] = 11
    local_player.bombs[i].x = bombx
    local_player.bombs[i].y = bomby
    local_player.bombs[i].placed=true
    local_player.bombs[i].frame=0
    addednewbomb=true

    end
    end
    end
    end


    function drawBombs()
    layer.explode:clear()
    for i=1,10 do
    if player.p1.bombs[i].placed then
    player.p1.bombs[i].time=player.p1.bombs[i].time-1
    end

    if player.p1.bombs[i].placed and player.p1.bombs[i].time>0 then --and not player.p1.bombs[i].active then

    layer.backpuffer:blit(Lev el.x+player.p1.bombs[i].x*16-16, Level.y+player.p1.bombs[i].y*16-16, images.gfx_bombs, tile.bomb.x+math.mod

    (framecount,tile.bomb.cyc le)*16, tile.bomb.y, 16, 16, true)

    elseif player.p1.bombs[i].time<=0 then -- or player.p1.bombs[i].active
    if Level.data[player.p1.bombs[i].x][player.p1.bombs[i].y]~=-1 then
    Level.data[player.p1.bombs[i].x][player.p1.bombs[i].y]=-1 --set it to KILL

    end

    explode(player.p1.bombs[i].x,player.p1.bombs[i].y,player.p1.bombs[i].frame)
    player.p1.bombs[i].frame=player.p1.bombs[i].frame+1

    if player.p1.bombs[i].time==0 then -- play sound only once!
    snd_explodelay() --play the boom sound
    end
    flame(player.p1,i,0,-1) --up!
    flame(player.p1,i,0,1) --down!
    flame(player.p1,i,-1,0) --left!
    flame(player.p1,i,1,0) --right!


    if player.p1.bombs[i].time<-9 then --its over reset the bomb

    Level.data[player.p1.bombs[i].x][player.p1.bombs[i].y]=0
    resetBomb(i, player.p1)
    end
    end
    end
    if not singleplayer then
    for i=1,10 do
    if player.p2.bombs[i].placed then
    player.p2.bombs[i].time=player.p2.bombs[i].time-1
    end

    if player.p2.bombs[i].placed and player.p2.bombs[i].time>0 then --and not player.p1.bombs[i].active then

    layer.backpuffer:blit(Lev el.x+player.p2.bombs[i].x*16-16, Level.y+player.p2.bombs[i].y*16-16, images.gfx_bombs,

    tile.bomb.x+math.mod(fram ecount,tile.bomb.cycle)*1 6, tile.bomb.y, 16, 16, true)


    elseif player.p2.bombs[i].time<=0 then -- or player.p2.bombs[i].active
    if Level.data[player.p2.bombs[i].x][player.p2.bombs[i].y]~=-2 then
    Level.data[player.p2.bombs[i].x][player.p2.bombs[i].y]=-2 --set it to KILL

    end

    explode(player.p2.bombs[i].x,player.p2.bombs[i].y,player.p2.bombs[i].frame)
    player.p2.bombs[i].frame=player.p2.bombs[i].frame+1

    if player.p2.bombs[i].time==0 then -- play sound only once!
    snd_explodelay() --play the boom sound
    end
    flame(player.p2,i,0,-1) --up!
    flame(player.p2,i,0,1) --down!
    flame(player.p2,i,-1,0) --left!
    flame(player.p2,i,1,0) --right!


    if player.p2.bombs[i].time<-9 then --its over reset the bomb

    Level.data[player.p2.bombs[i].x][player.p2.bombs[i].y]=0
    resetBomb(i, player.p2)
    end
    end
    end
    end
    end


    function resetBomb(i, local_player)

    local_player.bombs[i].placed=false
    local_player.bombs[i].time=60
    local_player.bombs[i].frame=0
    local_player.bombs[i].x = 0
    local_player.bombs[i].y = 0
    end

    function flame(local_player,i,x,y)


    for flame=1,local_player.flam elength-1 do

    if local_player.bombs[i].x+flame*x >= table.getn(Level.data)+1 or
    local_player.bombs[i].x+flame*x <= 0 or
    local_player.bombs[i].y+flame*y >= table.getn(Level.data[1])+1 or
    local_player.bombs[i].y+flame*y <= 0 then
    break

    end

    if Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] <= 0 or Level.data[local_player.bombs[i].x+flame*x]

    [local_player.bombs[i].y+flame*y] == 3 then

    if local_player.bombs[i].time>-8 then
    if local_player==player.p1 then
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y]=-1
    elseif local_player==player.p2 then
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y]=-2
    end
    explode(local_player.bomb s[i].x+flame*x,local_player.b ombs[i].y+flame*y,local_player.b ombs[i].frame )


    else
    if Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] == 3 then
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y]=3
    else
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y]=3
    end
    end


    elseif Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] == 11 or
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] == 12 then

    donateBombAt(local_player .bombs[i].x+flame*x,local_player.b ombs[i].y+flame*y)




    elseif Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] == 1 or
    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] >= 100 then --breaking wall = 100..108

    break


    elseif (Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] == 2) and (local_player.bombs[i].time > -8) then

    Level.data[local_player.bombs[i].x+flame*x][local_player.bombs[i].y+flame*y] = 100
    break
    end
    end
    end


    function donateBombAt(x,y)

    for i=1,10 do

    if player.p1.bombs[i].x == x and player.p1.bombs[i].y == y then
    player.p1.bombs[i].placed=true
    player.p1.bombs[i].time=0
    break --> exit loop&function
    end
    end
    end


    function explode(x,y,framenumber)
    posx = x*16-16+Level.x --104-16
    posy = y*16-16+Level.y ---16+8 (center of the tile)
    layer.explode:blit(posx, posy, images.gfx_bombs, framenumber*16-16,tile.bombexplode.y,16, 16, true)
    end


    function newGame()
    layer.map:clear()
    updatePlayers()
    drawMap()
    score = 0
    end

    function keyboardControl()
    screen.waitVblankStart()
    pad = Controls.read()
    updatePlayerTiles() --update the player position
    p1_moves = false
    p2_moves = false

    if pad:up() then
    if canMove(player.p1, up) then
    movement.p1.dx = 0
    movement.p1.dy = -.5
    p1_moves=true

    if player.p1.lastdirection ~= up then --yes was different
    player.p1.lastdirection = up
    player.p1.direction = up
    movement.p1.speedy = player.p1.speed
    movement.p1.speedx = 0
    end
    end
    elseif pad:down() then
    if canMove(player.p1, down) then
    movement.p1.dx = 0
    movement.p1.dy = .5
    p1_moves=true
    if player.p1.lastdirection ~= down then --yes was different
    player.p1.lastdirection = down
    player.p1.direction = down
    movement.p1.speedy = player.p1.speed
    movement.p1.speedx = 0
    end
    end
    elseif pad:left() then
    if canMove(player.p1, left) then
    movement.p1.dx = -.5
    movement.p1.dy = 0
    p1_moves=true
    if player.p1.lastdirection ~= left then --yes was different
    player.p1.lastdirection = left
    player.p1.direction = left
    movement.p1.speedy = 0
    movement.p1.speedx = player.p1.speed
    end
    end
    elseif pad:right() then
    if canMove(player.p1, right) then
    movement.p1.dx = .5
    movement.p1.dy = 0
    p1_moves=true
    if player.p1.lastdirection ~= right then --yes was different
    player.p1.lastdirection = right
    player.p1.direction = right
    movement.p1.speedy = 0
    movement.p1.speedx = player.p1.speed
    end
    end
    end

    if singleplayer then
    if pad:cross() then -- p1 lay bomb
    --lay bomb code here
    playerDropBomb(player.p1)
    end
    if pad:triangle() then
    screen:save("screenshot.t ga")
    end

    else
    if pad:cross() then -- p1 lay bomb
    --lay bomb code here
    playerDropBomb(player.p1)
    end
    if pad:triangle() then
    screen:save("screenshot.t ga")
    end
    end

    if p1_moves then -- only if a key is pressed move the little *******
    player.p1.move=true
    else
    player.p1.move=false
    end
    if p2_moves then -- only if a key is pressed move the little *******
    player.p2.move=true
    else
    player.p2.move=false
    end
    move()
    end

    function artificial_i()
    player2_posix=player.p2.x
    player2_posiy=player.p2.y
    player1_posix=player.p1.x
    player1_posiy=player.p1.y

    if freemovement==false then
    if player.p2.tiley > player.p1.tiley then
    ai_movement(up)
    currentdirection=up

    elseif player.p2.tiley < player.p1.tiley then
    ai_movement(down)

    elseif player.p2.tilex < player.p1.tilex then
    ai_movement(right)

    elseif player.p2.tilex > player.p1.tilex then
    ai_movement(left)
    currentdirection=left
    end
    d1x=player2_posix-player1_posix
    d1y=player2_posiy-player2_posiy
    distance_between=math.sqr t( d1x*d1x + d1y*d1y )
    if distance_between < 40 and dropage==true then
    ai_movement(drop)
    dropage=false
    elseif distance_between > 150 then
    dropage=true
    end
    if dropage == false then
    freemovement=true
    end






    end
    if freemovement==true then
    if player.p2.tiley < player.p1.tiley then
    ai_movement(up)
    currentdirection=up

    elseif player.p2.tiley > player.p1.tiley then
    ai_movement(down)

    elseif player.p2.tilex > player.p1.tilex then
    ai_movement(right)

    elseif player.p2.tilex < player.p1.tilex then
    ai_movement(left)
    currentdirection=left
    end
    d1x=player2_posix-player1_posix


    d1y=player2_posiy-player1_posiy
    distance_between=math.sqr t( d1x*d1x + d1y*d1y )
    if distance_between > 120 then
    dropage=true
    freemovement=false

    end
    end
    if oldy==player.p2.y and player.p2.tilex > player.p1.tilex and currentdirection ~= left then
    ai_movement(left)
    end
    if oldx==player.p2.x and player.p2.tiley > player.p1.tiley and currentdirection ~= up then
    ai_movement(up)
    end
    oldy=player.p2.y
    oldx=player.p2.x

    end

    function ai_movement(directional)

    if directional==up then
    if canMove(player.p2, up) then
    movement.p2.dx = 0
    movement.p2.dy = -1
    p2_moves=true
    --was the last direction something else?
    if player.p2.lastdirection ~= up then --yes was different
    player.p2.lastdirection = up
    player.p2.direction = up
    movement.p2.speedy = player.p2.speed
    movement.p2.speedx = 0
    end
    end
    elseif directional==down then
    if canMove(player.p2, down) then
    movement.p2.dx = 0
    movement.p2.dy = 1
    p2_moves=true
    if player.p2.lastdirection ~= down then --yes was different
    player.p2.lastdirection = down
    player.p2.direction = down
    movement.p2.speedy = player.p2.speed
    movement.p2.speedx = 0
    end
    end
    elseif directional==left then
    if canMove(player.p2, left) then
    movement.p2.dx = -1
    movement.p2.dy = 0
    p2_moves=true
    if player.p2.lastdirection ~= left then --yes was different
    player.p2.lastdirection = left
    player.p2.direction = left
    movement.p2.speedy = 0
    movement.p2.speedx = player.p2.speed
    end
    end
    elseif directional==right then
    if canMove(player.p2, right) then
    movement.p2.dx = 1
    movement.p2.dy = 0
    p2_moves=true
    if player.p2.lastdirection ~= right then --yes was different
    player.p2.lastdirection = right
    player.p2.direction = right
    movement.p2.speedy = 0
    movement.p2.speedx = player.p2.speed
    end
    end
    end

    if directional==drop then -- p1 lay bomb

    playerDropBomb(player.p2)
    end

    if p1_moves then
    player.p1.move=true
    else
    player.p1.move=false
    end
    if p2_moves then
    player.p2.move=true
    else
    player.p2.move=false
    end
    move()

    end


    function move()
    if player.p1.move then

    player.p1.x = player.p1.x+movement.p1.d x*movement.p1.speedx
    player.p1.y = player.p1.y+movement.p1.d y*movement.p1.speedy
    updatePlayers()
    end
    if not singleplayer then
    if player.p2.move then

    player.p2.x = player.p2.x+movement.p2.d x*movement.p2.speedx
    player.p2.y = player.p2.y+movement.p2.d y*movement.p2.speedy
    updatePlayers()
    end
    end
    end


    function death(local_player, killer)
    if not local_player.undestroyabl e then
    if local_player == player.p1 then
    local_player.tilex = Startpos.p1.x
    local_player.tiley = Startpos.p1.x
    local_player.posx = Level.x+Startpos.p1.x*16-16
    local_player.posy = -14+Startpos.p1.x*16-16
    local_player.x = Level.x+Startpos.p1.x*16-16
    local_player.y = -14+Startpos.p1.y*16-16
    else
    local_player.tilex = Startpos.p2.x
    local_player.tiley = Startpos.p2.x
    local_player.posx = Level.x+Startpos.p2.x*16-16
    local_player.posy = -14+Startpos.p2.x*16-16
    local_player.x = Level.x+Startpos.p2.x*16-16
    local_player.y = -14+Startpos.p2.y*16-16
    end
    local_player.visible=fals e
    local_player.undestroyabl e=true
    local_player.freeze = 30 --freeze a sec
    local_player.deaths=local _player.deaths+1
    if local_player==killer then

    local_player.suicide=loca l_player.suicide+1
    else
    killer.kills=killer.kills +1
    end
    updatePlayers()
    end
    end

    function updatePlayers()

    player.p1.posx = player.p1.x+8-Level.x
    player.p1.posy = player.p1.y+21

    if not singleplayer then
    player.p2.posx = player.p2.x+8-Level.x
    player.p2.posy = player.p2.y+21
    end
    end

    function canMove(local_player, direction)
    if local_player.freeze>0 then
    return false
    end


    if local_player.tiley-1<=0 and direction==up then
    if local_player.y>=8-Level.y then
    return true
    else
    return false
    end
    end

    if local_player.tilex-1<=0 and direction==left then
    if local_player.x>=Level.x then
    return true
    else
    return false
    end
    end

    if local_player.tilex+1>=tab le.getn(Level.data) and direction==right then
    if local_player.x<=(Level.x+ 448) then --16*28 then
    return true
    else
    return false
    end
    end

    if local_player.tiley+1>=tab le.getn(Level.data[1]) and direction==down then

    if local_player.y<=Level.y+1 90 then --level.y=24
    return true
    else
    return false
    end
    end


    x1=local_player.posx
    y1=local_player.posy
    x2=local_player.tilex
    y2=local_player.tiley


    if collide(x1,y1,x2,y2,1,dir ection) or collide(x1,y1,x2,y2,2,dir ection) then
    return false
    else
    return true
    end
    end

    function collide(x1,y1,x2,y2,point ,dir)

    if Level.data[x2+check_tiles[dir][1]][y2+check_tiles[dir][2]]==nil then
    return false
    elseif Level.data[x2+check_tiles[dir][1]][y2+check_tiles[dir][2]] > 0 and Level.data[x2+check_tiles[dir][1]][y2+check_tiles[dir][2]] ~= 3then
    -- there is a solid floor! --return true
    x2=x2*16-16+check_coordinates[dir][point][1]
    y2=y2*16-16+check_coordinates[dir][point][2]
    dx=(x2 - x1)
    dy=(y2 - y1)
    dist = math.sqrt( dx*dx + dy*dy )
    if dist<10 then --worked fine with 10 --with 9 you can walk though ONE ****ING BLOCK
    --print('collide')
    return true
    else
    --print('free to walk')
    return false
    end
    end
    return false
    end


    function saveHighscore()
    file = io.open(highscoreFile, "w")
    if file then
    file:write(high)
    file:close()
    end
    end

    function loadHighscore()
    file = io.open(highscoreFile, "r")
    if file then
    high = file:read("*n")
    file:close()
    end
    end


    function updatePlayerTiles()

    player.p1.tilex = math.floor((player.p1.pos x) / 16) +1
    player.p1.tiley = math.floor((player.p1.pos y) / 16) +1

    player.p2.tilex = math.floor((player.p2.pos x) / 16) +1
    player.p2.tiley = math.floor((player.p2.pos y) / 16) +1


    end

    function checkPlayers()

    if Level.data[player.p1.tilex][player.p1.tiley] == -1 then
    death(player.p1, player.p1)

    elseif Level.data[player.p1.tilex][player.p1.tiley] == -2 then
    death(player.p1,player.p2 )

    end

    if Level.data[player.p2.tilex][player.p2.tiley] == -2 then
    death(player.p2,player.p2 )

    elseif Level.data[player.p2.tilex][player.p2.tiley] == -1 then
    death(player.p2,player.p1 )

    end
    end

    function defreeze()
    if player.p1.freeze>0 then
    player.p1.freeze=player.p 1.freeze-1
    elseif player.p1.freeze==0 and player.p1.visible==false then
    player.p1.visible=true
    player.p1.undestroyable=f alse
    end
    if not singleplayer then
    if player.p2.freeze>0 then
    player.p2.freeze=player.p 2.freeze-1
    elseif player.p2.freeze==0 and player.p2.visible==false then
    player.p2.visible=true
    player.p2.undestroyable=f alse
    end
    end
    end

    function initMovement()
    for all in player do
    movement[all].speedx = player[all].speed
    movement[all].speedy = player[all].speed
    end
    end


    function checkGameType()

    local p1_points, p2_points
    p1_points = player.p1.kills-player.p1.suicide
    p2_points = player.p2.kills-player.p2.suicide

    if LEVEL_TYPE == GameType.TimePoints.title then
    if (playtime/1000)> GameType.Time.time then
    if p1_points > p2_points then
    gameOver = 'Player 1 Wins!'
    elseif p2_points > p1_points then
    gameOver = 'Player 2 Wins!'
    else
    gameOver = 'Draw'
    end
    end
    elseif LEVEL_TYPE == GameType.TimeKills.title then
    if (playtime/1000)> GameType.Time.time then
    if player.p1.kills > player.p2.kills then
    gameOver = 'Player 1 Wins!'
    elseif player.p2.kills > player.p1.kills then
    gameOver = 'Player 2 Wins!'
    else
    gameOver = 'Draw'
    end
    end
    elseif LEVEL_TYPE == GameType.Points.title then
    if p1_points >= GameType.Points.value or
    p2_points >= GameType.Points.value then
    if p1_points > p2_points then
    gameOver = 'Player 1 Wins!'
    elseif p2_points > p1_points then
    gameOver = 'Player 2 Wins!'
    else
    gameOver = 'Draw'
    end
    end
    elseif LEVEL_TYPE == GameType.Kills.title then
    if player.p1.kills >= GameType.Kills.value or
    player.p2.kills >= GameType.Kills.value then
    if player.p1.kills > player.p2.kills then
    gameOver = 'Player 1 Wins!'
    elseif player.p2.kills > player.p1.kills then
    gameOver = 'Player 2 Wins!'
    else
    gameOver = 'Draw'
    end
    end
    end
    end






    math.randomseed(os.diffti me())

    Level.data = transposeMatrix(Level.dat a)


    initMovement()




    while gameOver=='false' do

    framecount = math.mod(framecount, 8)+1
    keyboardControl()
    drawMap()
    artificial_i()
    if Level.usebackground then
    layer.backpuffer:blit(0, 0, layer.background, 0, 0, layer.background:width(), layer.background:height() , false)
    layer.backpuffer:blit(0, 0, layer.map, 0, 0, layer.map:width(), layer.map:height(), true) --set to true if there is a good bG
    else
    layer.backpuffer:blit(0, 0, layer.map, 0, 0, layer.map:width(), layer.map:height(), false) --set to true if there is a good bG
    end
    drawSprites();
    layer.backpuffer:blit(0, 0, layer.explode, 0, 0, layer.explode:width(), layer.explode:height(), true)
    drawPlayers()
    checkPlayers()
    screen:blit(0, 0, layer.backpuffer, 0, 0, layer.backpuffer:width(), layer.backpuffer:height() , false)
    drawStats()
    if score > high then
    high = score
    end
    defreeze()
    screen.waitVblankStart(1)
    screen.flip()
    checkGameType()
    if pad:start() then
    break
    end
    end

    dofile("./winner.lua")
    Geändert von dracule (11-27-2006 um 07:23 PM Uhr) Grund: Automerged Doublepost
    [size=-3][color=#fefefe]11[/color][color=white]0[/color][color=#fbfbfb]1[/color][color=#f1f4f6]0[/color][color=#f2f5f8]0[/color][color=#f7f8fa]1[/color][color=#fcfcfc]0[/color][color=#fdfefd]0[/color][color=#fffffe]1[/color][color=#fefefe]1[/color][color=white]1[/color][color=#fefefe]000[/color][color=white]1[/color][color=#fefefe]0[/color][color=white]0[/color][color=#fefefe]1111011[/color][color=white]1[/color][color=#fefefe]1[/color][color=white]101[/color]
    [color=white]1[/color][color=#fffefe]0[/color][color=#cad3e0]0[/color][color=#6f7f9c]1[/color][color=#788eaf]0[/color][color=#98b7d6]0[/color][color=#99c0e1]0[/color][color=#9ac2e2]1[/color][color=#a5c6e2]1[/color][color=#a6c3e2]0[/color][color=#b2bed1]1[/color][color=#dbe2ed]0[/color][color=#f7f9fa]1[/color][color=#fefefd]10110[/color][color=#fefefe]01[/color][color=#fefefd]0[/color][color=#fefefe]1[/color][color=#fefefd]10[/color][color=#fefefe]1[/color][color=white]00100[/color]
    [color=#fefefe]0[/color][color=#f2f6f8]0[/color][color=#566da3]0[/color][color=#8a919d]1[/color][color=#e2e5e4]0[/color][color=#eff2f3]0[/color][color=#eef2f6]1[/color][color=#e8eef3]1[/color][color=#dfe6ee]1[/color][color=#d1dee8]0[/color][color=#c1cddd]1[/color][color=#7997ce]1[/color][color=#8ea4d1]1[/color][color=#ebeeee]0[/color][color=#fdfef9]0[/color][color=#fefffa]1[/color][color=#fefefc]01101011[/color][color=#fefefd]1[/color][color=#fefefe]00[/color][color=white]10[/color][color=#fefefe]1[/color]
    [color=#fefefe]1[/color][color=#dde3ef]0[/color][color=#4866a7]1[/color][color=#b3bbc6]0[/color][color=#fafbf7]1[/color][color=#fefefc]0[/color][color=#f6f7f9]0[/color][color=#a8b6cf]1[/color][color=#6a7c9b]0[/color][color=#6886b2]0[/color][color=#7697c8]0[/color][color=#85a3cd]1[/color][color=#6287c3]1[/color][color=#496eb6]1[/color][color=#98abce]0[/color][color=#dde5e5]1[/color][color=#fcfef4]0[/color][color=#fdfef7]1[/color][color=#fefffa]100[/color][color=#fefefb]00[/color][color=#fefefc]00[/color][color=#fefefd]1[/color][color=#fefefe]1[/color][color=white]0[/color][color=#fefefe]0[/color][color=white]1[/color]
    [color=#fefefd]0[/color][color=#f8fafa]0[/color][color=#a7bce4]1[/color][color=#6887cf]0[/color][color=#9eb0d3]1[/color][color=#e3e9ec]1[/color][color=#bbc4d6]0[/color][color=#405b99]1[/color][color=#848b97]0[/color][color=#c2cace]0[/color][color=#c2cdd7]1[/color][color=#bdcce0]0[/color][color=#94acd4]1[/color][color=#547dc3]1[/color][color=#385ea9]1[/color][color=#496eb1]1[/color][color=#90a7c7]1[/color][color=#dde4e4]1[/color][color=#f6f9ee]1[/color][color=#fcfef3]1[/color][color=#fdfff5]1[/color][color=#fdfef7]1[/color][color=#fdfef8]0[/color][color=#fdfef9]1[/color][color=#fefefa]1[/color][color=#fefffb]1[/color][color=#fefefb]0[/color][color=#fefefc]1[/color][color=#fefefe]11[/color]
    [color=#fefefc]01[/color][color=#fcfdfc]0[/color][color=#e6ecf7]0[/color][color=#9fb5e7]0[/color][color=#6889cf]0[/color][color=#6b86c0]1[/color][color=#415ba1]0[/color][color=#6c82b0]0[/color][color=#d4d9da]0[/color][color=#f4f6ec]0[/color][color=#f8faf1]1[/color][color=#f5f8f3]0[/color][color=#e0e7ec]1[/color][color=#a0b7d8]1[/color][color=#5e82c2]0[/color][color=#2e5fb4]0[/color][color=#4065b0]1[/color][color=#809cc5]1[/color][color=#cdd7d9]1[/color][color=#f7f9e9]0[/color][color=#fafcef]1[/color][color=#fcfef2]1[/color][color=#fdfef5]1[/color][color=#fdfef6]1[/color][color=#fdfef9]0[/color][color=#fefff9]1[/color][color=#fefffa]1[/color][color=#fefefc]10[/color]
    [color=#fefefc]1100[/color][color=#fbfcfc]1[/color][color=#e8eff7]1[/color][color=#a5b8e6]1[/color][color=#5a7cc9]1[/color][color=#3a589d]0[/color][color=#3c5ba2]1[/color][color=#8d9fc1]1[/color][color=#d8deda]0[/color][color=#f4f7e8]0[/color][color=#f5f8ec]1[/color][color=#f1f5ea]0[/color][color=#dee5e4]1[/color][color=#b1c2d5]0[/color][color=#6b8dc7]1[/color][color=#416dba]1[/color][color=#3965b2]0[/color][color=#6c88b8]1[/color][color=#b5c3cd]0[/color][color=#e4e8df]1[/color][color=#f7f8e8]0[/color][color=#fbfdef]1[/color][color=#fcfef4]0[/color][color=#fdfff7]1[/color][color=#fefffa]0[/color][color=#fefefb]0[/color][color=#fefefc]1[/color]
    [color=#fefffb]1[/color][color=#fefefb]1[/color][color=#fefefc]0[/color][color=#fefffb]10[/color][color=#fdfefa]1[/color][color=#f9fbf9]0[/color][color=#dce4f1]1[/color][color=#94aada]1[/color][color=#4567b4]0[/color][color=#2c509f]0[/color][color=#4c6bac]0[/color][color=#a0adc3]1[/color][color=#e3e6db]0[/color][color=#f0f2e2]1[/color][color=#f0f3e4]0[/color][color=#ecf0e3]0[/color][color=#dde1dd]0[/color][color=#b1bfd1]0[/color][color=#7893bf]0[/color][color=#416fb7]0[/color][color=#3c66ad]0[/color][color=#6181b8]1[/color][color=#a3b2c8]1[/color][color=#dfe4de]1[/color][color=#f1f3e6]0[/color][color=#fafbf0]0[/color][color=#fcfdf6]1[/color][color=#fdfff8]1[/color][color=#fefffa]0[/color]
    [color=#fefffa]10[/color][color=#fefefa]1[/color][color=#fefffa]1[/color][color=#fefff9]11[/color][color=#fdfef8]1[/color][color=#fcfdf4]0[/color][color=#f5f7f3]0[/color][color=#d6dee9]1[/color][color=#809ad5]0[/color][color=#3a5cad]1[/color][color=#264a9f]1[/color][color=#4e6aad]1[/color][color=#a8b3c5]1[/color][color=#e2e4d5]1[/color][color=#ebecda]1[/color][color=#edeee0]0[/color][color=#e9ebde]0[/color][color=#dee1db]1[/color][color=#bfc7cd]1[/color][color=#869ec2]1[/color][color=#5479ba]1[/color][color=#3665b4]1[/color][color=#466aaf]0[/color][color=#7f95b9]1[/color][color=#c5ccd0]1[/color][color=#f2f3e6]0[/color][color=#f9faef]1[/color][color=#fcfef4]0[/color]
    [color=#fdfef7]10110[/color][color=#fdfef5]1[/color][color=#fdfdf2]1[/color][color=#fbfdf1]0[/color][color=#fbfcf0]0[/color][color=#f6f8ec]0[/color][color=#eaece8]0[/color][color=#c0cbdc]1[/color][color=#6e88c5]1[/color][color=#3657ab]0[/color][color=#2d4ea1]1[/color][color=#5b73ac]1[/color][color=#b1b9c1]1[/color][color=#dbdccf]0[/color][color=#e5e6d4]0[/color][color=#e6e7d7]0[/color][color=#e4e5da]0[/color][color=#d9ddd5]1[/color][color=#c1caca]0[/color][color=#99a9be]1[/color][color=#6584b9]1[/color][color=#4369b1]0[/color][color=#3f5fa1]0[/color][color=#7586a6]0[/color][color=#dcddd0]1[/color][color=#f4f4e7]1[/color]
    [color=#fcfdf1]01[/color][color=#fcfcf0]1[/color][color=#fcfcef]1[/color][color=#fcfcf0]1[/color][color=#fcfcef]0[/color][color=#fbfced]0[/color][color=#f9fbeb]1[/color][color=#f9faea]1[/color][color=#f7f8e7]0[/color][color=#f3f4e6]1[/color][color=#eeeee2]1[/color][color=#dbdfdb]0[/color][color=#a4b1ca]1[/color][color=#5670b4]1[/color][color=#284ca4]1[/color][color=#2e4e9a]0[/color][color=#6d80aa]1[/color][color=#bcc0bb]0[/color][color=#d9dbc9]1[/color][color=#dfe0ce]0[/color][color=#e2e3d2]0[/color][color=#dfe1d2]1[/color][color=#d7dbd0]1[/color][color=#c4cbc9]1[/color][color=#96a2b6]0[/color][color=#3c558e]0[/color][color=#56637f]0[/color][color=#d0d2c2]0[/color][color=#eae9db]0[/color]
    [color=#fafbec]1[/color][color=#f9faea]1000[/color][color=#f8f8e8]0[/color][color=#f7f7e6]1[/color][color=#f5f7e5]0[/color][color=#f5f5e3]0[/color][color=#f3f3e1]1[/color][color=#f1f1dd]0[/color][color=#eeeedc]0[/color][color=#ececda]0[/color][color=#e3e4d4]0[/color][color=#ced0c9]0[/color][color=#8e9db9]1[/color][color=#4766ac]0[/color][color=#234799]0[/color][color=#2e4c96]0[/color][color=#727d93]1[/color][color=#c1c2b1]0[/color][color=#d0d2c0]0[/color][color=#c1c6c1]1[/color][color=#9ba3b1]0[/color][color=#677591]0[/color][color=#415179]1[/color][color=#515d75]1[/color][color=#9fa29b]0[/color][color=#dbdacc]0[/color][color=#eceadb]0[/color]
    [color=#f6f5e5]10[/color][color=#f5f4e4]1[/color][color=#f5f5e3]01[/color][color=#f3f3e1]0[/color][color=#f3f2de]1[/color][color=#f2f1e0]0[/color][color=#f0efdc]0[/color][color=#efeed9]0[/color][color=#edecd8]0[/color][color=#ebebd6]1[/color][color=#e8e8d2]1[/color][color=#e3e2cd]0[/color][color=#e0dfcb]1[/color][color=#d6d6c6]1[/color][color=#b7bcbf]0[/color][color=#7a8cb0]1[/color][color=#4564a7]0[/color][color=#354d81]1[/color][color=#616b7f]0[/color][color=#57657f]1[/color][color=#445371]1[/color][color=#4f586b]1[/color][color=#6f7478]0[/color][color=#999b93]0[/color][color=#bdbeb0]1[/color][color=#d7d6c6]0[/color][color=#e5e3d3]1[/color][color=#eae9d8]0[/color]
    [color=#f1f0dd]0[/color][color=#f1efdc]0[/color][color=#f1f0e0]1[/color][color=#f0efdc]0[/color][color=#f0f0db]1[/color][color=#f0efd9]1[/color][color=#eeedd8]1[/color][color=#ededd7]1[/color][color=#ebebd4]0[/color][color=#eae9d3]0[/color][color=#e8e7d2]1[/color][color=#e6e6cf]0[/color][color=#e4e4cc]1[/color][color=#e2e2ca]1[/color][color=#e0dfca]0[/color][color=#dddcc6]0[/color][color=#d7d8c3]0[/color][color=#cdcfbd]1[/color][color=#adb1ac]1[/color][color=#868f95]1[/color][color=#777e7f]1[/color][color=#82867f]1[/color][color=#9d9e8f]1[/color][color=#b7b6a2]0[/color][color=#c6c6b0]1[/color][color=#d0d0ba]1[/color][color=#d7d6c3]0[/color][color=#dddcc9]0[/color][color=#e2e1ce]1[/color][color=#e5e4d1]0
    [/color][/size]
    [SIZE=1]a paper clip made by thekon[/SIZE]

  19. #4369
    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 I have this code but it wont work what is wrong?
    Code:
    file = io.open("Score.txt", "r")
    
    score1 = file:read()
    
    file:close()
    file = io.open("Score.txt","w")
    
    score1 = score1 + 100
    file:write(score1)
    file:close()

  20. #4370
    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

    file = io.open("Score.txt", "r")

    score1 = file:read("*n")

    file:close()
    score1 = score1 + 100
    file = io.open("Score.txt","w+")
    file:write(score1)
    file:close()

    Try that

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

    k hold on.....
    -= Double Post =-
    That didnt work either....it did nothing
    Geändert von the undead (11-28-2006 um 09:12 PM Uhr) Grund: Automerged Doublepost

  22. #4372
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    what videos will lua player play ?

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

    videos? i dont think it supports videos

  24. #4374
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    I didnt think so either but that dragons lair demo on frontpage has video so im confused

  25. #4375
    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

    It isn't video, just lots of images.

  26. #4376
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Oh kk now it makes sense. That games gonna take up loooooooooadz of space ...

  27. #4377
    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

    Zitat Zitat von Access_Denied
    high = io.open("high.txt","r")
    highscore = high:read()
    high:close()

    if score > highscore then
    high = io.open("high.txt","w")
    high:write(score)
    high:close()
    end
    i have a problem, it always tells me something like
    error: cant compare string with number...
    what should i do? :/

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

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

    Standard

    How do you unload images from the psp's memory?
    I have tried:
    image = nil
    image = false
    but neither unload the image?
    Would screen:clear do the job?
    (i couldn't imagine it though...)
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

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

    Screen:clear simply clears the screen. The pictures are actually stored in the variables and are blited when the variable is called so i would think you just assign the variable to something else like nil or something.
    EDIT: anyways as you know im making my game and i just want to see what everyone thinks about it and if you see any errors can you point them out.
    Spoiler for My Game:
    -- Im Changing up Maze of Doom and I've been coming up with more ideas weekly so Im starting on this

    -- time to declare some variables
    --colors
    green = Color.new(0, 255, 0)
    red = Color.new(255, 0, 0)
    black = Color.new(0, 0, 0)

    --sprites
    demon = Image.load("demon.png")
    creature = Image.load("creature.png" )

    -- the player looks in different directions right?
    splayer = {}
    --now hes looking straight
    splayer[1] = Image.load("lL.png")
    --now hes looking left
    splayer[2] = Image.load("lR.png")
    --now hes looking right
    splayer[3] = Image.load("lU.png")
    --now hes looking back
    splayer[4] = Image.load("lD.png")

    --now for the variable that makes his head turn .. literally
    direction = 1

    --more sprites
    bullet = Image.createEmpty(1,1)
    bullet:clear(black)

    --and the level we are on
    background = Image.load("background.pn g")


    -- player's health and armor and the aliens'
    health = 100
    armor = 50
    demonhp = 10

    --how long it takes to reload
    reload = Timer.new()

    --the player's bullets
    ammo = 1

    -- some tables
    Player = {}
    Player[1] = {x=0, y=0}

    -- your ammo
    Bullet = {}
    Bullet[1] = {Player[1].x, Player[1].y}

    --the creatures table
    creature = {}
    creature[1] = { x = 10, y = 10 }

    --whether the demon is alive or not
    demonal = {}
    demonal[1] = "true"
    demonal[2] = "true"
    demonal[3] = "true"
    demonal[4] = "true"
    demonal[5] = "true"
    demonal[6] = "true"

    -- the demon tables
    demon = {}
    demon[1] = {x = 400, y = 110}
    demon[2] = {x = 390, y = 80}
    demon[3] = {x = 410, y = 30}
    demon[4] = {x = 420, y = 20}
    demon[5] = {x = 400, y = 200}
    demon[6] = {x = 270, y = 260}

    --this is for our creature movement
    --prevents the same random numbers on each program run
    math.randomseed(os.time() )

    --x=width y=height
    -- REMINDER ^^^^

    -- the main loop
    while true do
    pad = Controls.read()
    screen:blit (0, 0, background)

    --lets print some things to the screen shall we
    screenrint(0, 0, "Alanan",red)
    screenrint(0, 5, health, red)
    screenrint(0, 10, armor, green)
    screenrint(0, 15, ammo, green)

    --lets make him move around
    screen:blit(Player[1].x,Player[1].y,splayer[direction])
    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 3
    direction = 1
    end

    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 3
    direction = 2
    end

    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 3
    direction = 3
    end

    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 3
    direction = 4
    end

    --we need our creature to move too
    screen:blit(creature[1].x,creature[1].y,creature)
    creaturemove = math.random(0,50)

    --now we make him move side note// i set creature move to math.random because i dont want him
    -- moving all the time or else he would reach the end of the screen way to fast.
    if creaturemove == 5 then
    creature[1].x = creature[1].x + 1
    end

    -- we have to blit are demons to the screen also

    if demonal[1] == "true" then
    screen:blit(demon[1].x,demon[1].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[2].x,demon[2].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[3].x,demon[3].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[4].x,demon[4].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[5].x,demon[5].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[6].x,demon[6].y,demon)
    end

    -- now we make them chase the creature
    --we are only gonna make two demons attack the creature
    -- the other four will guard the exit

    --heres demon 1
    if demon[1].x > creature[1].x then
    demon[1].x = demon[1].x - 1
    end

    if demon[1].x < creature[1].x then
    demon[1].x = demon[1].x + 1
    end

    if demon[1].y > creature[1].y then
    demon[1].y = demon[1].y - 1
    end

    if demon[1].y < creature[1].y then
    demon[1].y = demon[1].y + 1
    end

    --now demon 2
    if demon[2].x > creature[1].x then
    demon[2].x = demon[2].x - 1
    end

    if demon[2].x < creature[1].x then
    demon[2].x = demon[2].x + 1
    end

    if demon[2].y > creature[1].y then
    demon[2].y = demon[2].y - 1
    end

    if demon[2].y < creature[1].y then
    demon[2].y = demon[2].y + 1
    end


    --lets get his gun firing and ammo is there for reload
    if pad:r() and ammo == 1 then
    screen:blit(Bullet[1].x,Bullet[1].y,bullet)
    fire = "true"
    ammo = ammo - 1
    reload:start()
    --what if hes out of ammo?
    elseif ammo == 0 then
    fire = "false"
    end

    --this makes his bullet he shoots go different ways depending on which way he faces
    if fire = "true" and direction == 1 then
    Bullet[1].x = Bullet[1].x + 2
    end

    if fire = "true" and direction == 2 then
    Bullet[1].x = Bullet[1].x - 2
    end

    if fire = "true" and direction == 3 then
    Bullet[1].y = Bullet[1].y - 2
    end

    if fire = "true" and direction == 4 then
    Bullet[1].y = Bullet[1].y + 2
    end

    -- now hes gotta reload
    if ammo == 0 and reload:time() == 10 then
    ammo = ammo + 1
    end

    --now lets make our bullet touch the demons
    if Bullet[1].x == demon[1].x and Bullet[1].y == demon[1].y then
    demonal[1] = "false"
    end

    if Bullet[1].x == demon[2].x and Bullet[1].y == demon[2].y then
    demonal[2] = "false"
    end

    if Bullet[1].x == demon[3].x and Bullet[1].y == demon[3].y then
    demonal[3] = "false"
    end

    if Bullet[1].x == demon[4].x and Bullet[1].y == demon[4].y then
    demonal[4] = "false"
    end

    if Bullet[1].x == demon[5].x and Bullet[1].y == demon[5].y then
    demonal[5] = "false"
    end

    if Bullet[1].x == demon[6].x and Bullet[1].y == demon[6].y then
    demonal[6] = "false"
    end












    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!

  30. #4380
    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 c5cha7
    How do you unload images from the psp's memory?
    I have tried:
    image = nil
    image = false
    but neither unload the image?
    Would screen:clear do the job?
    (i couldn't imagine it though...)
    image = nil will remove the image from memory, and replace it with nothing, so you literally have a variable with no value assigned to it. thats the same thing as unloading.
    --------------------------------------------------------------------------------------


 

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 .