Seite 180 von 342 ErsteErste ... 80 130 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 230 280 ... LetzteLetzte
Zeige Ergebnis 5.371 bis 5.400 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; Zitat von Yongobongo Can someone help me? I have an error when using dofile() and then loading the same file ...

  
  1. #5371
    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
    Can someone help me? I have an error when using dofile() and then loading the same file again...Loop ingettable?
    yes, print some of your code here and ill try to help ya out

    @Anti QJ... Very good point....but still....:)


    I got a Question myself...
    How would you make your game "pause" if say.. Start was pressed? This has been puzzling me for a while now..


    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.

  2. #5372
    QJ Gamer Blue
    Points: 4.209, Level: 41
    Level completed: 30%, Points required for next Level: 141
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    72
    Points
    4.209
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von GuitarGod1134
    If you talking about my post (because I think you are) yes actually it will make a difference. Changing that last variable to false will play the song once or once everytime it is called. Trust me I made a app with a tuner in it.
    I guess I worded it wrongly because I was talking about his problem of the music playing slowly and laggy.

    And actually another possible problem that I just thought of is that if you have your Music.playfile in your while true loop, then it will play over and over without getting a chance to finish

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

    then he can put the music.playfile in a if statement.
    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!

  4. #5374
    QJ Gamer Blue
    Points: 4.209, Level: 41
    Level completed: 30%, Points required for next Level: 141
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    72
    Points
    4.209
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark
    yes, print some of your code here and ill try to help ya out

    @Anti QJ... Very good point....but still....:)


    I got a Question myself...
    How would you make your game "pause" if say.. Start was pressed? This has been puzzling me for a while now..
    Code:
    if Controls.read:start() then
    pausemenu()
    I reccomend making the pause menu a whole different function because then this stops the rest of the game from playing. In that function, you can load and blit some images, a cursor, have some options (continue game, restart game, return to menu, etc.) . if you dont know how to go about doing this, I reccomend using a variable like this:

    Code:
    if pad:up() then x=x+1 end
    if pad:down() then x=x-1 end
    
    if x=1 then 
    (code for cursor at position 1)
    if pad:cross() then
    (code for what to do it x is pressed when cursor is at position 1)
    end
    end
    
    if x==2 then...
    I also have a question of my own: How do I blit an image to the screen without disturbing whatever is already there, such as without the screen:clear()?

    When I just do it without the screen:clear() then the screen flickers for some reason. But the new image does not flicker. Only the old one.

    using screen:save(...) takes up too much time and it's impractical. So is there a better way to do it?

  5. #5375
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Another question hehe

    So I have the variable Player and Object. How can I make it so when the Player collides with the Object it does something? I tried EvilMana's tutorial on collision and it didn't work becuase it didn't use images. Here's the source.
    http://shark-flash.com/ryan/lua.rar

    Thanks :)

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

    BlackShark - Here's a basic, complete Pong game, with pause menu Ive just wrote up, so you get an example.

    (why am i being so generous? i havent wrote a pong game in ages...)
    Code:
    Player = {}
    Player[1] = { x=10,y=86,score=0,image=Image.createEmpty(20,50) }
    Player[2] = { x=450,y=86,score=0,image=Image.createEmpty(20,50) }
    
    Ball = { x=235,y=131,xs=3,ys=3,image=Image.createEmpty(10,10) }
    
    Player[1].image:clear(Color.new(0,0,255))
    Player[2].image:clear(Color.new(0,255,0))
    Ball.image:clear(Color.new(255,255,255))
    
    paused = false
    oldpad = Controls.read()
    
    while true do
    	screen:clear()
    	pad = Controls.read()
    
    	-- toggle pause screen on/off
    	if pad:start() and oldpad:start() ~= pad:start() then paused = not paused end
    
    	if paused then
    		screen:fillRect(210,125,53,20,Color.new(255,255,255))
    		screen:print(214,131,"Paused",Color.new(0,0,0))
    		-- place other code here, for controls and whatnot...
    	else -- game mechanics go here... for pong there simple as pi
    		Ball.x = Ball.x + Ball.xs -- Ball.x += horizontal vector speed
    		Ball.y = Ball.y + Ball.ys -- Ball.y += vertical vector speed
    
    		if Ball.y < 0 then Ball.ys = 5
    		elseif Ball.y + 10 > 272 then Ball.ys = -5 end
    	
    		if Ball.x <= 30 and Ball.y >= Player[1].y and Ball.y + 10 <= Player[1].y + 50 then Ball.xs = 5 end 
    		if Ball.x+10 >= 450 and Ball.y >= Player[2].y and Ball.y + 10 <= Player[2].y + 50 then Ball.xs = -5 end 
    
    		if Ball.x < 0 then
    			Ball.xs = 5
    			Player[2].score = Player[2].score + 1
    		elseif Ball.x + 10 > 480 then
    			Ball.xs = -5
    			Player[1].score = Player[1].score + 1
    		end
    
    		if pad:up() and Player[1].y > 0 then Player[1].y = Player[1].y - 5
    		elseif pad:down() and Player[1].y + 50 < 272 then Player[1].y = Player[1].y + 5 end
    
    		if pad:triangle() and Player[2].y > 0 then Player[2].y = Player[2].y - 5
    		elseif pad:cross() and Player[2].y + 50 < 272 then Player[2].y = Player[2].y + 5 end	
    	end
    
    	-- Main Drawing
    
    	screen:blit(Ball.x,Ball.y,Ball.image)
    	screen:blit(Player[1].x,Player[1].y,Player[1].image)
    	screen:blit(Player[2].x,Player[2].y,Player[2].image)	
    
    	screen:print(0,0, "Player 1's Score:  " .. Player[1].score .. "                   Player 2's Score:  " .. Player[2].score,Color.new(255,0,255))
    
    	oldpad = pad
    	screen.waitVblankStart() -- constant 60 FPS
    	screen.flip()
    end
    Took ~8 minutes - [sarcasm]enjoy[/sarcasm]

    ZOMG!!!! CAN I GET DEV STATUS NOW?!?
    -= Double Post =-
    Zero - EvilMana is gay. They are sooooo specific that all the code there teaches you is how to copy & paste... Try somethign like this:

    http://forums.qj.net/f-psp-developme...xes-53916.html

    I wrote that ages ago... And i demonstrated it using 2 printed label text things (aka - no images as you suggested)
    Geändert von SG57 (01-28-2007 um 05:01 PM Uhr) Grund: Automerged Doublepost

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


  7. #5377
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    I wrote that ages ago... And i demonstrated it using 2 printed label text things (aka - no images as you suggested)
    I actually meant collision with images XD

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

    Ok, than simply provide the width/height parameters with the width and height of your iamges. Simply logic goes a long way...

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


  9. #5379
    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 SG57
    BlackShark - Here's a basic, complete Pong game, with pause menu Ive just wrote up, so you get an example.

    (why am i being so generous? i havent wrote a pong game in ages...)
    Spoiler for code:
    Code:
    Player = {}
    Player[1] = { x=10,y=86,score=0,image=Image.createEmpty(20,50) }
    Player[2] = { x=450,y=86,score=0,image=Image.createEmpty(20,50) }
    
    Ball = { x=235,y=131,xs=3,ys=3,image=Image.createEmpty(10,10) }
    
    Player[1].image:clear(Color.new(0,0,255))
    Player[2].image:clear(Color.new(0,255,0))
    Ball.image:clear(Color.new(255,255,255))
    
    paused = false
    oldpad = Controls.read()
    
    while true do
    	screen:clear()
    	pad = Controls.read()
    
    	-- toggle pause screen on/off
    	if pad:start() and oldpad:start() ~= pad:start() then paused = not paused end
    
    	if paused then
    		screen:fillRect(210,125,53,20,Color.new(255,255,255))
    		screen:print(214,131,"Paused",Color.new(0,0,0))
    		-- place other code here, for controls and whatnot...
    	else -- game mechanics go here... for pong there simple as pi
    		Ball.x = Ball.x + Ball.xs -- Ball.x += horizontal vector speed
    		Ball.y = Ball.y + Ball.ys -- Ball.y += vertical vector speed
    
    		if Ball.y < 0 then Ball.ys = 5
    		elseif Ball.y + 10 > 272 then Ball.ys = -5 end
    	
    		if Ball.x <= 30 and Ball.y >= Player[1].y and Ball.y + 10 <= Player[1].y + 50 then Ball.xs = 5 end 
    		if Ball.x+10 >= 450 and Ball.y >= Player[2].y and Ball.y + 10 <= Player[2].y + 50 then Ball.xs = -5 end 
    
    		if Ball.x < 0 then
    			Ball.xs = 5
    			Player[2].score = Player[2].score + 1
    		elseif Ball.x + 10 > 480 then
    			Ball.xs = -5
    			Player[1].score = Player[1].score + 1
    		end
    
    		if pad:up() and Player[1].y > 0 then Player[1].y = Player[1].y - 5
    		elseif pad:down() and Player[1].y + 50 < 272 then Player[1].y = Player[1].y + 5 end
    
    		if pad:triangle() and Player[2].y > 0 then Player[2].y = Player[2].y - 5
    		elseif pad:cross() and Player[2].y + 50 < 272 then Player[2].y = Player[2].y + 5 end	
    	end
    
    	-- Main Drawing
    
    	screen:blit(Ball.x,Ball.y,Ball.image)
    	screen:blit(Player[1].x,Player[1].y,Player[1].image)
    	screen:blit(Player[2].x,Player[2].y,Player[2].image)	
    
    	screen:print(0,0, "Player 1's Score:  " .. Player[1].score .. "                   Player 2's Score:  " .. Player[2].score,Color.new(255,0,255))
    
    	oldpad = pad
    	screen.waitVblankStart() -- constant 60 FPS
    	screen.flip()
    end

    Took ~8 minutes - [sarcasm]enjoy[/sarcasm]

    ZOMG!!!! CAN I GET DEV STATUS NOW?!?
    -= Double Post =-
    Zero - EvilMana is gay. They are sooooo specific that all the code there teaches you is how to copy & paste... Try somethign like this:

    http://forums.qj.net/f-psp-developme...xes-53916.html

    I wrote that ages ago... And i demonstrated it using 2 printed label text things (aka - no images as you suggested)
    Cool, thanks SG.
    Code:
    ZOMG!!!! CAN I GET DEV STATUS NOW?!?
    What are you implying :/
    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.

  10. #5380
    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

    That pong games shouldnt get someone a developer status, especially since there are 1 billion of them open source on the internet... What i just typed up and posted was a fully functional pong game... It has score and everything. Technically, it is a game - but the difficulty it took to make it was not worth a Developer title.

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


  11. #5381
    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

    O Ok, i agree with that :), as My sig sais, Im trying to EARN dev status, and i don't think i should do it with PvP Pong :), again, thanks
    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.

  12. #5382
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Ok, than simply provide the width/height parameters with the width and height of your iamges. Simply logic goes a long way...
    The only problem is I don't know where in the world to put the code

  13. #5383
    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 ZeroMega
    The only problem is I don't know where in the world to put the code
    post ur code and ill tell u

  14. #5384
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    post ur code and ill tell u
    http://shark-flash.com/ryan/lua.rar

    Usually if I see some things visually I get a basic understanding of it, just like when I was doing script in Flash.

  15. #5385
    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 need to know WHAT you want to happen... But this is the just of it:
    Code:
    function TestCollsions()
         if Collision(Player[1].x,Player[1].y,playerWidth,playerHeight,object[1].x,object[1].y,objectWidth,objectHeight) then
                 -- wahtever you want to happen when they  collide
    end
    end
    Youll need to go get my function from the link i posted and paste it in your code, than you may use this...

    Oh and note - to your main while true do loop, add somewhere i nthere 'TestCollisions()'

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


  16. #5386
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Still not getting it lol

  17. #5387
    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 SG57
    I need to know WHAT you want to happen... But this is the just of it:
    Code:
    function TestCollsions()
         if Collision(Player[1].x,Player[1].y,playerWidth,playerHeight,object[1].x,object[1].y,object.width,object.height) then
                 -- wahtever you want to happen when they  collide
    end
    end
    Youll need to go get my function from the link i posted and paste it in your code, than you may use this...

    Oh and note - to your main while true do loop, add somewhere i nthere 'TestCollisions()'
    And you can put the word object in the parenthasees (spelling ) that way you dont have to rewrite the collision detection for say your player touching zombies and your player touching skeletons like this
    Code:
    function TestCollsions(object)
         if Collision(Player[1].x,Player[1].y,playerWidth,playerHeight,object[1].x,object[1].y,object.width,object.height) then
                 -- wahtever you want to happen when they  collide
    end
    end
    now when you call your function
    [code]
    while true do
    screen:clear()
    TestCollisions(zombies)
    TestCOllisions(skeletons) --see no more object, putting those thier replaces all objects with zombies and skeletons. also remember to declare playerWidth, playerHeight, objectWidth, objectHeight as they are variables not functions so they need values assigned to them. To obtain this you can either open up paint and find thier height and stuff or use skeleton:height() or skeleton:height() but the variable skeleton must be the image being loaded not your coordinates, for coordinates i usually just add a c ie skeletonc.x yata yata.
    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!

  18. #5388
    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

    Damn, SG, for some reason its not working for mine, heres part of the code..

    Spoiler for code:
    --***Main Game Loop***
    while true do
    screen:clear()
    pad = Controls.read()

    if pad:start() and oldpad:start() ~= pad:start() and paused == false then paused = true end
    if pad:start() and oldpad:start() ~= pad:start() and paused == true then paused = false end

    if paused == true then
    screen:fillRect(210,125,5 3,20,Color.new(255,255,25 5))
    screenrint(214,131,"Paused", red)
    elseif paused == false then
    rnumber = math.random(1,10)
    gamestime=gametimer:time( )


    ammunition() --Calls for the Ammo configurations--
    screen:blit(100, 0, background1)
    screen:blit(0, 0, hud)
    mugShot()
    playerimg:blit(player.x, player.y, 30)
    screenrint(375, 10, "Fighter Name", white)
    screenrint(380, 25, ""..user, red)
    screenrint(408, 130, "Score:"..score, white)
    screenrint(413, 100, "High", red)
    screenrint(408, 110, "Score:"..tscore, red)
    screenrint(5, 150, "Ammo:"..ammo, white)
    screenrint(45, 255, chargebar.number.."%", red)
    healthBar()
    shootbarS()
    chargeShot()
    screen:fontPrint(proporti onal, 220, 25, time, red)
    --Shoots gun
    if pad:r() and oldpad:r() ~= pad:r() and shootbar.number == 50 and player.State == "alive" then
    shootbar.number = 0
    firelay()
    bulletSetup()
    end



    if player.State == "dead" then
    pex:blit(player.x -30, player.y - 30, 100)
    boomlay()
    end
    if pex:getFrame() == 4 then
    screen.waitVblankStart(75 )
    dofile("menu.lua")
    end
    highScore()
    collisionCheck(enemy1hit)
    collisionCheck2(enemy2hit )
    collisionCheck3(enemy3hit )
    collisionCheckp(playerhit )
    enemy1AI()
    enemy2AI()
    enemy3AI()
    EBFire()
    EB2Fire()
    EB3Fire()
    bulletFire()
    screen:flip()
    pmove()

    --Game timer countdown
    if gamestime>1000 then time=time - 1 gametimer:reset(0) gametimer:start() end

    if time < 0 and score < tscore then
    screen:clear()
    screenrint(100, 100, user.."'s Score Was:"..score, white)
    screen:flip()
    screen.waitVblankStart(20 0)
    dofile("menu.lua")
    elseif time < 0 and score > tscore then
    tscore = score
    file = io.open("tscore.txt","w")
    myText = score
    file:write(myText)
    file:close()

    file = io.open("tuser.txt","w")
    myText = user
    file:write(myText)
    file:close()
    screen:clear()
    newhilay()
    screenrint(100, 100, user.."'s Score Was:"..score, white)
    screenrint(100, 110, "A NEW hight score!!!", red)
    screen:flip()
    screen.waitVblankStart(20 0)
    dofile("menu.lua")
    end

    --This is for Music on/off feature
    if pad:triangle() and oldpad:triangle() ~= pad:triangle() and Music.playing() == true then
    Music.pause()
    end
    if pad:circle() and oldpad:circle() ~= pad:circle() and Music.playing() == false then
    Music.resume()
    end

    screen.waitVblankStart()
    oldpad = pad
    end
    end


    I also have

    paused = false

    defined above the main loop, still no luck, any suggestions....
    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. #5389
    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

    Uh, ya... Optimize your code in 3 ways...

    1. Use the pause menu toggling method i did in my little game
    Code:
    -- globally state this in your while true do loop
    if pad:start() and pad:start() ~= oldpad:start() then paused = not paused end
    2. Indent your code so it's actually understandable without mind boggling mental indentation (if you actually want me to give you an answer tonight, than do this first)
    3. Inline some of your code for optimization (above code snippet is inlined the pause toggling), and optimize things here and there such as this:
    Code:
    if paused then
         screen:print(0,0,"Right now the game is Paused")
    else
         screen:print(0,0,"Right now the game is NOT Paused")
    end
    Right now your using unneeded arguments in some if statements. By optimizing them like above, you save in file size (and processign time as welll, as the interpreter doesnt need to read in as much data) so in the end its a good habit all around.

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


  20. #5390
    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 tried it that way, No luck thats why i change it, i just tryed that way again, still no luck.
    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.

  21. #5391
    QJ Gamer Green
    Points: 5.400, Level: 47
    Level completed: 25%, Points required for next Level: 150
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    London
    Beiträge
    165
    Points
    5.400
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    I've finished my Pong game! Thanks to everyone for their help.

    Next: Breakout!

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

    Hey peeps just a quick question. Say if i wanted my player to rotate on a left angle when the left pad was pressed how would i code this? I've never used angles.

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

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

    Standard

    Are you intending to rotate the image?

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

    Yes that's what i had in mind

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

    Then you need to use the GU or vector graphics as any other method will be too slow to use in real time gameplay unless you have strips of your character walking in every direction.

  26. #5396
    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

    looks like i need to get learning. Links ? i thought gu was only for 3d ?

  27. #5397
    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 Blake1
    I've finished my Pong game! Thanks to everyone for their help.

    Next: Breakout!
    Nice if you need any help send me a PM or something :P
    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.

  28. #5398
    Points: 3.511, Level: 37
    Level completed: 8%, Points required for next Level: 139
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Beiträge
    19
    Points
    3.511
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard need help

    i am just getting into coding LUA and am finding myself confused. i am just learning so im trying to keep it simple but i need help. i am trying to display text that says "Bricking" for one second and have that replaced by text that says "Bricking." and "Bricking.." then "Bricking..." and then repeat itself but i cant figure out how, can someone help?

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

    mmm, ya know..I already made a prank bricker :) (look in my sig)
    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.

  30. #5400
    Points: 3.511, Level: 37
    Level completed: 8%, Points required for next Level: 139
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Beiträge
    19
    Points
    3.511
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    yeah, but i just want to code simple text for now. i have

    blue = Color.new(0, 0, 255)

    screenrint(200, 130, "Bricking", blue)
    screen.flip()

    while true do
    screen.waitVblankStart(60 )

    screenrint(200, 130, "Bricking.", blue)
    screen.flip()

    while true do
    screen.waitVblankStart(60 )

    screenrint(200, 130, "Bricking..", blue)
    screen.flip()

    while true do
    screen.waitVblankStart(60 )

    screenrint(200, 130, "Bricking...", blue)
    screen.flip()

    end

    but it doesnt work, any advice?


 

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 .