Results 1 to 2 of 2

Thread: Really basic animated hello world, not working

  
  1. #1
    Davasaurous is offline -Hacks Newbie
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Default Really basic animated hello world, not working

    Code:
    StartNotHit = true
    i = 0
    GoingLeft = true
    
    while StartNotHit do
    	pad = Controls.read()
    	if pad:start() then StartNotHit = false end
    	screen:clear()
    	
    	screen:print(200 + i, 135, "Hello World", Color.new(0,255,0))
    	if GoingLeft == true then i = i + 1 end
    	if GoingLeft == false then i = i - 1 end
    	if i == 100 then GoingLeft = False end
    	if i == 1 then GoingLeft = True end
    	
    	screen:flip()
    end
    I have no idea what's wrong with it. Hello World just sits there not moving :\

    Obviously I fucked up my logic or something. Any help?


  2. #2
    10$man's Avatar
    10$man is offline Programmer -Hacks Smarty
    Join Date
    Jun 2010
    Posts
    100
    Rep Power
    8

    Smile Help

    This might be a bit late but if your still interested here is a correct code of yours ( I dont have my psp to test right now but i am pretty sure that is right...)
    Code:
    -->>>>create vars<<<<<<
    i = 0
    goingLeft = 1
    red = Color.new(255,0,0)
    -->>>>loop<<<<
    while true do
    screen:clear()
    
    if goingLeft == 1 then 
         i = i + 1
    end
    
    if goingLeft == 0 then
         i = i - 1
    end
    
    if i == 300 then
        goingLeft = 0
    end
    
    if i == 100 then
         goingLeft = 1
    end
    
    screen:print(i,0,"Hello, World",red)
    
    screen.flip()
    screen.waitVblankStart()
    end
    Last edited by 10$man; 07-04-2010 at 11:04 PM.
    My PSPz: PSP 2000 5.00 m33-4, PSP 1000 GEN d3

    Group Projects: Game (unannounced)

    personal Projects: Shotgun fun fun psp, Learning exploiting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •