Seite 171 von 342 ErsteErste ... 71 121 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 221 271 ... LetzteLetzte
Zeige Ergebnis 5.101 bis 5.130 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; Code: distance = SQUARE ROOT ( (x2 - x1)^2 + (y2 - y1)^2) ) The angle angle between to points? ...

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

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

    Standard

    Code:
    distance = SQUARE ROOT ( (x2 - x1)^2 + (y2 - y1)^2) )
    The angle angle between to points? You could get the slope, plot the hypotetnues and use sine/cosine or tangent to get the angle.



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

    Projects

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


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

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

    Standard

    Code:
    name:blit(whatever)
    This is from animlib. What do I put in the whatever section? Actually all I need to know is how to blit animations.

  3. #5103
    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 eyece
    this is more of a general programing question, but how do you get the angle and distance between 2 points, (x1,y1,x2,y2).

    Code:
    angle = atan2(x2-x1, y2-y1)
    --------------------------------------------------------------------------------------

  4. #5104
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Cheez Pirate
    Code:
    name:blit(whatever)
    This is from animlib. What do I put in the whatever section? Actually all I need to know is how to blit animations.
    easy one,...
    example:blit(0, 0. 100)

    "name" of animation : "blit" obvious, (X, Y, "time between frames")
    the time between frames is how fast the animation is (or slow) the higher the number the longer the pause.


    NOW FOR MY QUESTION

    I KNOW this has came up b4, but how EXACTLY do you fade in and Out? im having troubles...
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

    they should seriously put animlib functions in the function reference area on the lua wiki site. im getting 50 pms every day.

    @ BlackShark- 1 sec, lemme write an example
    -= Double Post =-
    @ BlackShark:

    heres a demo, havent tested it, but it should work:

    Code:
    test = Image.load("test1.png")
    bg = Image.createEmpty(480, 272)
    
    speed = 1
    fade = 255
    
    while true do
    
    screen:clear()
    pad = Controls.read()
    
    if fade >= 0 then
    	bg:clear(Color.new(0,0,0,fade))
    	screen:blit(0,0,bg)
    	screen:blit(0,0,test)
    	fade = fade - speed
    end
    
    screen.flip()
    screen.waitVblankStart()
    end
    Geändert von Grimfate126 (01-17-2007 um 08:26 PM Uhr) Grund: Automerged Doublepost
    --------------------------------------------------------------------------------------

  6. #5106
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    ok, thanks a bunch! going to test it now( also much thanks for animLib! animations would really suck without it...)
    -= Double Post =-
    Damn, does not seem to work, I tried switching the blit positions of bg and my image but that didn't work neither
    what i mean by that is i took

    screen:blit(0, 0, bg)
    screen:blit(0, 0, contest)

    and stitched them.... cuz other wise the "contest" image would blit on top of the fader, but that still didn't work..
    Geändert von BlackShark (01-17-2007 um 08:39 PM Uhr) Grund: Automerged Doublepost
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  7. #5107
    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 BlackShark
    ok, thanks a bunch! going to test it now( also much thanks for animLib! animations would really suck without it...)
    -= Double Post =-
    Damn, does not seem to work, I tried switching the blit positions of bg and my image but that didn't work neither
    what i mean by that is i took

    screen:blit(0, 0, bg)
    screen:blit(0, 0, contest)

    and stitched them.... cuz other wise the "contest" image would blit on top of the fader, but that still didn't work..

    what do you mean by "doesnt work"?

    also, are you trying this on windows lua?
    --------------------------------------------------------------------------------------

  8. #5108
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Y? is it psp luaplayer Only? in that case ill try it out on my psp!
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  9. #5109
    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 BlackShark
    Y? is it psp luaplayer Only? in that case ill try it out on my psp!
    windows lua doesnt support transparency, so even if it did work, it wouldnt look like it.
    --------------------------------------------------------------------------------------

  10. #5110
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Cool, it works, any idea on how to fade out?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

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

    Standard

    I use this in all my games (in LUA so far) to fade from black to an image, then wait for abutton to press, then to fade from that image to black.
    Code:
    -- get rid of any display buffer resido from game menu
    screen:clear()
    screen.waitVblankStart()
    screen.flip()
    
    --  Intro
    bg_music = Sound.load("Sound/menu.wav",true)
    music = bg_music:play( )
    bullet = Sound.load("Sound/bullet.wav")
    reload = Sound.load("Sound/reload.wav")
    click = Sound.load("Sound/enemy_fire.wav")
    
    intro = Image.load("GFX/logo.png")
    fader = Image.createEmpty(480,272)
    alphaValue = 255
    faderColor = Color.new(0,0,0,alphaValue)
    fader:clear(faderColor)
    while true do
    	screen:clear()
    	screen:blit(0,0,intro)
    	screen:blit(0,0,fader)
    	faderColor = Color.new(0,0,0,alphaValue)
    	fader:clear(faderColor)
    	screen.waitVblankStart()
    	screen.flip()
    	if alphaValue > 0 then
    		alphaValue = alphaValue - 1
    	else
    		break
    	end
    end
    while true do
    	blah = Controls.read()
    	if blah:cross() or 
    	   blah:circle() or 
    	   blah:square() or
    	   blah:triangle() or 
    	   blah:start() or 
    	   blah:select() or 
    	   blah:left() or 
    	   blah:right() or 
    	   blah:down() or 
    	   blah:up() or 
    	   blah:l() or 
    	   blah:r() then 
    	   	break 
    	end
    end
    while true do
    	screen:clear()
    	screen:blit(0,0,intro)
    	screen:blit(0,0,fader)
    	if alphaValue < 255 then
    		alphaValue = alphaValue + 1
    	else
    		break
    	end
    	faderColor = Color.new(0,0,0,alphaValue)
    	fader:clear(faderColor)
    	screen.waitVblankStart()
    	screen.flip()
    end
    Just copy the fade in or out code to sepearte the 2. But make sure you make the alphaValue = 0 when fading out, and 255 when fading in.

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

    Projects

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


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

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

    Standard

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    
    dofile("lib/animlib.lua")
    
    logo = ANIM.new(8,"logo","png","logo/")
    
    loadingscreen = Image.load("images/loadingscreen.png")
       
    loadingbar = {}
    loadingbar.y = 12
    
    data = {}
    data.loaded = 0
    
    cursor = Image.load("images/cursor.png")
    data.loaded = data.loaded + 25 * 4
    
    nameofimage = nil
    
    while true do
    
    	pad = Controls.read()
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1)
    	logo:free()
    	screen:clear(white)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
    	screen.flip()
    end
    It won't load the begining animation. It seems like it just skips it. Then it goes directly to the load menu and in less than half a second it disapears and says I have an error on lib/animlib.lua:130: and the loading menu doesn't use animlib. But the logo does. (the very first thing that shows up. The animation.)

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

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

    Standard

    Want to know why?

    Code:
    while true do -- START of loop 
    
    	pad = Controls.read()
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1) -- draw animation
    	logo:free() -- free animation before even flipping the screen
    	screen:clear(white)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
    	screen.flip()
    end -- end of loop - go back to START of loop
    SEe the problem?

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

    Projects

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


  14. #5114
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Uber cool, it works, thanks SG57 and GrimFate! very helpfull.
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

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

    Standard

    so i put screen.flip() before freeing the animation and after blitting it?

  16. #5116
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    I believe so..
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

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

    Standard

    Has anyone got any AI tuts? I'm at a dead loss

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

  18. #5118
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Yongobongo
    Has anyone got any AI tuts? I'm at a dead loss
    I second this, specifically space shooter kind of AI with enemies firing..
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

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

    Standard

    Check your PM blackshark, the chart by Vaza is a good resource ;)
    Anyone who knows of AI tuts/snippets, i would still really like to see them as my code is very basic, and kind of crappy

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

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

    Yongobongo: I gave you this 2-3 pages back
    Zitat Zitat von yaustar
    Here is a start. Look around Gamedev for more or get a good book: http://www.gamedev.net/reference/art...article784.asp
    Here is the complete listing from GameDev.
    http://www.gamedev.net/reference/list.asp?categoryid=18

    There are also tons at http://gamasutra.com

  21. #5121
    QJ Gamer Silver
    Points: 11.326, Level: 70
    Level completed: 19%, Points required for next Level: 324
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    871
    Points
    11.326
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Here this is my code:
    Code:
    blue = Color.new(0, 0, 255)
    
    function playerMovement()
    
    Player = {X = 0, Y = 0, Health = 18}
    
    if pad:left() then
    Player.X = Player.X - 8
    elseif pad:right() then
    Player.X = Player.X + 8
    elseif pad:up() then
    Player.Y = Player.Y - 8
    elseif pad:down() then
    Player.Y = Player.Y + 8
    end
    
    end
    
    
    while true do
    
    pad = Controls.read()
    
    playerMovement()
    
    screen:print(Player.X,Player.Y,"@",blue)
    
    screen.waitVblankStart()
    screen.flip()
    end
    but as you can see its printing a moving text...But when i press a every direction ones I end up with 5 "@" and it won't go further like EG:
    ->@
    @@@ and when i press further more then once nothing happends.
    ->@

    SO I want to know how do I erase other "@" as I press and How to make I go Further then only once.
    Free Prizes at Prizerebel Join us!
    I already got 11 Gifts. Ask me for details or proof.

  22. #5122
    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

    After while true do put screen:clear(). And to keep him onscreen, you can do one of two things. Edit hiks movement or put boundaries.

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

    In function playerMovement, you set the player's position to 0, 0 every time the function is called.

  24. #5124
    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

    Hi my game is near release *fingers crossed* but i have one problem. When he goes over the cheese and score goes up 1 i want the cheese to go to another random position. Anybody got tips on how to do this ?

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

    Zitat Zitat von eldiablov
    Hi my game is near release *fingers crossed* but i have one problem. When he goes over the cheese and score goes up 1 i want the cheese to go to another random position. Anybody got tips on how to do this ?
    Simple

    If player over the cheese then
    cheese.x = math.random and cheese.y = math.random
    end

    Basically when he hits that cheese and you get the score then you redeclare the cheese's coordinates to... whatever you want in your case a random number.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

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

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

    Standard

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    
    dofile("lib/animlib.lua")
    
    logo = ANIM.new(8,"logo","png","logo/")
    
    loadingscreen = Image.load("images/loadingscreen.png")
       
    loadingbar = {}
    loadingbar.y = 11
    
    data = {}
    data.loaded = 0
    
    cursor = Image.load("images/cursor.png")
    data.loaded = data.loaded + 25 * 4
    
    nameofimage = nil
    
    while true do
    
    	pad = Controls.read()
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1)
    	screen.flip()
    	screen:clear(white)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
            screen.flip()
    end
    Everything loads. But at the same time. I know it's because of the 2 screen.flip()'s but I can't fix it. I put "end" behind the first screen.flip() and that doesn't work either.

  27. #5127
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Has anyone got any AI tuts? I'm at a dead loss
    it depends on how to have programed your game.

    whats the function name for getting the square root, i remember seeing it somewhere, somthing like math.squrRoot()

  28. #5128
    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 Cheez Pirate
    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    
    dofile("lib/animlib.lua")
    
    logo = ANIM.new(8,"logo","png","logo/")
    
    loadingscreen = Image.load("images/loadingscreen.png")
       
    loadingbar = {}
    loadingbar.y = 11
    
    data = {}
    data.loaded = 0
    
    cursor = Image.load("images/cursor.png")
    data.loaded = data.loaded + 25 * 4
    
    nameofimage = nil
    
    while true do
    
    	pad = Controls.read()
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1)
    	screen.flip()
    	screen:clear(white)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
            screen.flip()
    end
    Everything loads. But at the same time. I know it's because of the 2 screen.flip()'s but I can't fix it. I put "end" behind the first screen.flip() and that doesn't work either.
    whats the problem?????
    --------------------------------------------------------------------------------------

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

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

    Standard

    Well it will load everything without errors but it will load and blit both the loading screen and the animation at the same time. And the screen will flash while doing so.

  30. #5130
    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

    Because its repeating it in a while true do.


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 07:52 AM Uhr.

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