The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the newest Gaming News from
QJ.NET in your email each day?




Want to learn more about the team who brings you the QJ news?

Read about them now!

 


Results 1 to 21 of 21

[Release] Light Cycle Clone V2.1 (improved ai)

This is a discussion on [Release] Light Cycle Clone V2.1 (improved ai) within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; here's a new release of my latest game. based on the tron lightcycle race. new features: -background -music player (plays ...

  
  1. #1
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default [Release] Light Cycle Clone V2.1 (improved ai)

    here's a new release of my latest game.

    based on the tron lightcycle race.



    new features:
    -background
    -music player (plays from psp/music if not empty, use shoulders buttons to change track)
    -improved ai (its actually worth playing against computer)

    to do:
    what features do people want?

    btw: i would like to thank Code Red for the snippets of code he added. :)

    DOWNLOAD HERE
    Last edited by titch.ryan; 06-25-2008 at 09:24 AM.

  2. #2
    Points: 8,185, Level: 61
    Level completed: 12%, Points required for next Level: 265
    Overall activity: 0%

    Join Date
    Aug 2006
    Location
    New Jersey
    Posts
    1,044
    QJ Pts
    8,185
    Level
    61
    Downloads
    0
    Uploads
    0

    Default

    Wifi?

  3. #3
    QJ Gamer Blue
    Points: 4,317, Level: 41
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Join Date
    Mar 2008
    Posts
    262
    QJ Pts
    4,317
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    3D lightcycles like in GLTron and WiFi multiplayer

  4. #4
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    3d wont happen as i have not got enough patience to learn the Gu.

    ad hoc or infrastructure? or both?

    i don't want to program ad hoc if its not actually going to be used!

  5. #5
    QJ Gamer Blue
    Points: 4,367, Level: 42
    Level completed: 9%, Points required for next Level: 183
    Overall activity: 54.0%

    Join Date
    Sep 2007
    Location
    BELGIUM !!
    Posts
    234
    QJ Pts
    4,367
    Level
    42
    Downloads
    0
    Uploads
    0

    Default

    Lua ?

    Cyaa

  6. #6
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    yes it is lua :)
    don't knock it till you've tried it lol

  7. #7
    Banned for LIFE
    Points: 18,744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Join Date
    Oct 2006
    Location
    East London, England
    Posts
    2
    QJ Pts
    18,744
    Level
    86
    Downloads
    0
    Uploads
    0

    Default

    Interesting, i'll check it out
    Last edited by eldiablov; 06-25-2008 at 09:41 AM.

  8. #8
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    i'm now working on wifi, may take a while as i've never done it before.

  9. #9
    QJ Gamer Blue
    Points: 4,317, Level: 41
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Join Date
    Mar 2008
    Posts
    262
    QJ Pts
    4,317
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by titch.ryan View Post
    3d wont happen as i have not got enough patience to learn the Gu.
    Ah, so you're a teenager

    As Lua apps go tho, this is one of the better ones I've seen - Good Job!

  10. #10
    Lua guy
    Points: 10,655, Level: 68
    Level completed: 52%, Points required for next Level: 195
    Overall activity: 0%

    Join Date
    Jan 2008
    Location
    Wales, cardiff
    Posts
    1,442
    QJ Pts
    10,655
    Level
    68
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by PhonicUK View Post
    Ah, so you're a teenager

    As Lua apps go tho, this is one of the better ones I've seen - Good Job!
    Whats wrong with being a teenager? lol
    Lua GAME
    Its quite good this i likey

  11. #11
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    18 next month so yes still a teenager i suppose.

    glad you like it.

  12. #12
    QJ Gamer Blue
    Points: 4,317, Level: 41
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Join Date
    Mar 2008
    Posts
    262
    QJ Pts
    4,317
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    I'm just picking on you, my point being that teenagers typically don't have the same level of patience. :P

    I'm glad I'm 21, I can pick on teenagers now!

  13. #13
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    if anyone is getting any errors replace the script.lua with this one

    sorry for the inconvenience

    Spoiler for script.lua:
    Code:
     --light cycle clone by luke ryan
    System.setHigh()
    math.randomseed(os.time())
    
    gamestate=0
    option_selected=1
    onewin=Image.load("images/p1win.png")
    twowin=Image.load("images/p2win.png")
    splash=Image.load("images/splash.png")
    menumn=Image.load("images/menu.png")
    meselcol=Color.new(196, 0, 72)
    menoselcol=Color.new(0, 189, 89)
    white=Color.new(255,255,255)
    gray=Color.new(128,128,128)
    
    speed=1
    
    checkcollision=false
    player={x=225,y=240, direction=1, colour=Color.new(255,20,147),width=5,height=5,life=5}
    playerblock=Image.createEmpty(3,3)
    playerblock:clear(player.colour)
    
    player.line=1
    player[player.line]={x=225,y=240,width=5,height=5}
    
    
    computer={x=250,y=240, direction=1, colour=Color.new(0,255,127),width=5,height=5,life=5}
    computerblock=Image.createEmpty(3,3)
    computerblock:clear(computer.colour)
    
    computer.line=1
    computer[computer.line]={x=250,y=240,width=5,height=5,direction=1}
    
    comthinktime=1
    
    ----------------------------------------------------------------------------------------
    function menu()
    
    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,splash)
    screen:blit(0,0,fader)
    if alphaValue > 0 then
    alphaValue = alphaValue - 5
    else
    break
    end
    faderColor = Color.new(0,0,0,alphaValue)
    fader:clear(faderColor)
    screen.waitVblankStart()
    screen.flip()
    end
    screen.waitVblankStart(200) 
    while true do
    screen:clear()
    screen:blit(0,0,splash)
    screen:blit(0,0,fader)
    if alphaValue < 255 then
    alphaValue = alphaValue + 5
    else
    gamestate=4
    break
    end
    faderColor = Color.new(0,0,0,alphaValue)
    fader:clear(faderColor)
    screen.waitVblankStart()
    screen.flip()
    end
    end
    
    function mainmenu()
    while true do
    pad=Controls.read()
    
    	if option_selected==1 then
    	screen:blit(0,0,menumn)
            screen:print(273, 115, "ONE PLAYER", meselcol)
            screen:print(273, 154, "TWO PLAYER", menoselcol)
            screen:print(267, 193, "VIEW CREDITS", menoselcol)
    	end
    
    	if option_selected==2 then
    	screen:blit(0,0,menumn)
            screen:print(273, 115, "ONE PLAYER", menoselcol)
            screen:print(273, 154, "TWO PLAYER", meselcol)
            screen:print(267, 193, "VIEW CREDITS", menoselcol)
    	end
    
    	if option_selected==3 then
    	screen:blit(0,0,menumn)
            screen:print(273, 115, "ONE PLAYER", menoselcol)
            screen:print(273, 154, "TWO PLAYER", menoselcol)
            screen:print(267, 193, "VIEW CREDITS", meselcol)
    	end
    
    	if pad:up() and oldpad:up() ~= pad:up() and option_selected>1 then
    	option_selected=option_selected-1
    	end
    
    	if pad:down() and oldpad:down() ~= pad:down() and option_selected<3 then
    	option_selected=option_selected+1
    	end
    
    	if pad:cross() then
    	oldpad=pad
    		if option_selected==1 then
    		gamestate=1
    		break
    		end
    
    		if option_selected==2 then
    		gamestate=2
    		break
    		end
    
    		if option_selected==3 then
    		gamestate=3
    		break
    		end
    
    	end
    
    screen.waitVblankStart()
    screen:flip()
    oldpad=pad
    end
    
    end
    --------------------------------------------------------------------------------------------------------------
    
    function oneplayer()
    
    while true do
    pad=Controls.read()
    screen:clear()
    
    CustomTracks()
    musiccontrol()
    
    	if checkcollision==false then
    	playermovement()
    
    		
    			for n=1, player.line do
    			computerai(player[n])
    			end
    			
    		if player.line> 2 then
    			for n=1,player.line-2 do
    			playercollision(player[n])
    			end
    		end
    
    		if computer.line> 2 then
    			for n=1,computer.line-2 do
    			computerai(computer[n])
    			computercollision(computer[n])
    			end
    		end
    
    	computeraimovement()
    	computeraiwalls()
    	
    		if checkcollision==false and computer.y>272 or computer.y<0 or computer.x<0 or computer.x>480 then
    		computer.life=computer.life-1
    		checkcollision=true
    		end
    
    		if checkcollision==false and player.y>272 or player.y<0 or player.x<0 or player.x>480 then
    		player.life=player.life-1
    		checkcollision=true
    		end
    
    		for n=1,computer.line do
    		collision(player,computer[n])
    		end
    	
    		for n=1,player.line do
    		collision(computer,player[n])
    		end
    
    		display()
    
    		if computer.line+player.line>5 then
    		speed=(computer.line+player.line)/2
    		end
    
    		screen.waitVblankStart()
    		screen:flip()
    		n=1
    		oldpad=pad
    
    	else
    
    	display()
    
    	screen:print(170,50,"Press START to Continue",Color.new(255,255,255))
    	screen:print(170,60," Press SELECT for menu",Color.new(255,255,255))
    
    		if pad:select() then
    		player.life=5
    		computer.life=5
    		resetvariables()
    		checkcollision=false
    		gamestate=4
                    break
    		end
    
    
    		if pad:start() then
    
    			if player.life==0 or computer.life==0 then
    			player.life=5
    			computer.life=5
    			end
    
    			resetvariables()
    			checkcollision=false
    		end
    
    		if player.life==0 then
    		screen:blit(0,0,twowin)
    		end
    
    		if computer.life==0 then
    		screen:blit(0,0,onewin)
    		end
    
    	screen.waitVblankStart()
    	screen:flip()
    	n=1
    	oldpad=pad
    	end
    end
    end
    --------------------------------------------------------------------------------------------------------------------
    function twoplayer()
    
    while true do
    pad=Controls.read()
    screen:clear()
    
    CustomTracks()
    musiccontrol()
    
    	if checkcollision==false then
    	display()
    	playermovement()
    	computermovement()
    
    		if player.line> 2 then
    			for n=1,player.line-2 do
    			playercollision(player[n])
    			end
    		end
    
    		if computer.line> 2 then
    			for n=1,computer.line-2 do
    			computercollision(computer[n])
    			end
    		end
    
    		if checkcollision==false and computer.y>272 or computer.y<0 or computer.x<0 or computer.x>480 then
    		computer.life=computer.life-1
    		checkcollision=true
    		end
    
    		if checkcollision==false and player.y>272 or player.y<0 or player.x<0 or player.x>480 then
    		player.life=player.life-1
    		checkcollision=true
    		end
    
    		for n=1,computer.line do
    		collision(player,computer[n])
    		end
    
    		for n=1,player.line do
    		collision(computer,player[n])
    		end
    
    		if computer.line+player.line>5 then
    		speed=(computer.line+player.line)/2
    		end
    
    	screen.waitVblankStart()
    	screen:flip()
    	n=1
    	oldpad=pad
    
    	else
    
    	display()
    
    	screen:print(170,50,"Press START to Continue",Color.new(255,255,255))
    	screen:print(170,60," Press SELECT for menu",Color.new(255,255,255))
    
    		if pad:select() then
    		player.life=5
    		computer.life=5
    		resetvariables()
    		checkcollision=false
    		gamestate=4
                    break
    		end
    
    		if pad:start() then
    
    			if player.life==0 or computer.life==0 then
    			player.life=5
    			computer.life=5
    			end
    	
    		resetvariables()
    		checkcollision=false
    		end
    
    		if player.life==0 then
    		screen:blit(0,0,twowin)
    		end
    
    		if computer.life==0 then
    		screen:blit(0,0,onewin)
    		end
    
    	screen.waitVblankStart()
    	screen:flip()
    	n=1
    	oldpad=pad
    	end
    end
    end
    --------------------------------------------------------------------------------------------------------------
    function playermovement()
    
    if pad:up() and oldpad:up()~=pad:up() and player.direction~=3 and player.direction~=1 then
    player.direction=1
    player.line=player.line+1
    player[player.line]={x=player.x,y=player.y,width=5,height=5}
    end
    
    if pad:down() and oldpad:down()~=pad:down() and player.direction~=1 and player.direction~=3 then
    player.direction=3
    player.line=player.line+1
    player[player.line]={x=player.x,y=player.y,width=5,height=5}
    end
    
    if pad:right() and oldpad:right()~=pad:right() and player.direction~=4 and player.direction~=2 then
    player.direction=2
    player.line=player.line+1
    player[player.line]={x=player.x,y=player.y,width=5,height=5}
    end
    
    if pad:left() and oldpad:left()~=pad:left() and player.direction~=2 and player.direction~=4 then
    player.direction=4
    player.line=player.line+1
    player[player.line]={x=player.x,y=player.y,width=5,height=5}
    end
    
    if player.direction==1 then
    player.y=player.y-speed
    player[player.line].height=player[player.line].height+speed
    player[player.line].y=player[player.line].y-speed
    end
    
    if player.direction==3 then
    player.y=player.y+speed
    player[player.line].height=player[player.line].height+speed
    end
    
    if player.direction==2 then
    player.x=player.x+speed
    player[player.line].width=player[player.line].width+speed
    end
    
    if player.direction==4 then
    player.x=player.x-speed
    player[player.line].width=player[player.line].width+speed
    player[player.line].x=player[player.line].x-speed
    end
    
    end
    
    ---------------------------------------------------------------------------------------------------------------------------------
    
    function computermovement()
    
    if pad:triangle() and oldpad:triangle()~=pad:triangle() and computer.direction~=3 and computer.direction~=1 then
    computer.direction=1
    computer.line=computer.line+1
    computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5}
    end
    
    if pad:cross() and oldpad:cross()~=pad:cross() and computer.direction~=1 and computer.direction~=3 then
    computer.direction=3
    computer.line=computer.line+1
    computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5}
    end
    
    if pad:circle() and oldpad:circle()~=pad:circle() and computer.direction~=4 and computer.direction~=2 then
    computer.direction=2
    computer.line=computer.line+1
    computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5}
    end
    
    if pad:square() and oldpad:square()~=pad:square() and computer.direction~=2 and computer.direction~=4 then
    computer.direction=4
    computer.line=computer.line+1
    computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5}
    end
    
    if computer.direction==1 then
    computer.y=computer.y-speed
    computer[computer.line].height=computer[computer.line].height+speed
    computer[computer.line].y=computer[computer.line].y-speed
    end
    
    if computer.direction==3 then
    computer.y=computer.y+speed
    computer[computer.line].height=computer[computer.line].height+speed
    end
    
    if computer.direction==2 then
    computer.x=computer.x+speed
    computer[computer.line].width=computer[computer.line].width+speed
    end
    
    if computer.direction==4 then
    computer.x=computer.x-speed
    computer[computer.line].width=computer[computer.line].width+speed
    computer[computer.line].x=computer[computer.line].x-speed
    end
    
    end
    
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    function playercollision(object)
    
    if checkcollision==false and (player.x + player.width > object.x) and (player.x < object.x + object.width) and (player.y + player.height > object.y) and (player.y < object.y + object.height) then
    player.life=player.life-1
    checkcollision=true
    end
    
    end
    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    
    function computercollision(object)
    
    if checkcollision==false and (computer.x + computer.width > object.x) and (computer.x < object.x + object.width) and (computer.y + computer.height > object.y) and (computer.y < object.y + object.height) then
    computer.life=computer.life-1
    checkcollision=true
    end
    
    end
    
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    
    function collision(objectone,objecttwo)
    
    if checkcollision==false and (objectone.x + objectone.width > objecttwo.x) and (objectone.x < objecttwo.x + objecttwo.width) and (objectone.y + objectone.height > objecttwo.y) and (objectone.y < objecttwo.y + objecttwo.height) then
    objectone.life=objectone.life-1
    checkcollision=true
    end
    
    end
    
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    function resetvariables()
    
    for n=1, player.line do
    player[player.line]=nil
    end
    
    for n=1, computer.line do
    computer[computer.line]=nil
    end
    
    System.memclean()
    
    speed=1
    
    player={x=225,y=240, direction=1, colour=Color.new(255,20,147),width=5,height=5,life=player.life}
    playerblock=Image.createEmpty(5,5)
    playerblock:clear(player.colour)
    
    player.line=1
    player[player.line]={x=225,y=240,width=5,height=5}
    
    
    computer={x=250,y=240, direction=1, colour=Color.new(0,255,127),width=5,height=5,life=computer.life}
    computerblock=Image.createEmpty(5,5)
    computerblock:clear(computer.colour)
    
    computer.line=1
    computer[computer.line]={x=250,y=240,width=5,height=5}
    
    comthinktime=1
    
    end
    
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    function display()
    
    screen:drawLine(15, 0, 15, 272, gray)
    screen:drawLine(49, 0, 49, 272, gray)
    screen:drawLine(83, 0, 83, 272, gray)
    screen:drawLine(117, 0, 117, 272, gray)
    screen:drawLine(151, 0, 151, 272, gray)
    screen:drawLine(185, 0, 185, 272, gray)
    screen:drawLine(219, 0, 219, 272, gray)
    screen:drawLine(253, 0, 253, 272, gray)
    screen:drawLine(287, 0, 287, 272, gray)
    screen:drawLine(321, 0, 321, 272, gray)
    screen:drawLine(355, 0, 355, 272, gray)
    screen:drawLine(389, 0, 389, 272, gray)
    screen:drawLine(423, 0, 423, 272, gray)
    screen:drawLine(457, 0, 457, 272, gray)
    screen:drawLine(0, 34, 480, 34, gray)
    screen:drawLine(0, 68, 480, 68, gray)
    screen:drawLine(0, 102, 480, 102, gray)
    screen:drawLine(0, 136, 480, 136, gray)
    screen:drawLine(0, 170, 480, 170, gray)
    screen:drawLine(0, 204, 480, 204, gray)
    screen:drawLine(0, 238, 480, 238, gray)
    
    screen:blit(player.x,player.y,playerblock)
    screen:blit(computer.x,computer.y,computerblock)
    
    for n=1, player.line do
    image=Image.createEmpty(player[n].width,player[n].height)
    image:clear(player.colour)
    screen:blit(player[n].x,player[n].y,image)
    end
    
    for n=1, computer.line do
    image=Image.createEmpty(computer[n].width,computer[n].height)
    image:clear(computer.colour)
    screen:blit(computer[n].x,computer[n].y,image)
    end
    
    
    screen:print(5,5,"player 1 life:"..player.life,player.colour)
    screen:print(300,5,"player 2 life:"..computer.life,computer.colour)
    
    end
    
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    function computerai(object)
    
    comthinktime=comthinktime+1
    
    if computer.line>2 then
    if computer.direction==1 and comthinktime>speed and (computer.y-speed < object.y + object.height) and (computer.x < object.x + object.width) and (computer.x + computer.width > object.x) then
    comthinktime=1
    	if computer[computer.line-1].direction==2 then
    	computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end
    n=1
    end
    
    if computer.direction==3 and comthinktime>speed and (computer.y + computer.height+speed> object.y) and (computer.x < object.x + object.width) and (computer.x + computer.width > object.x) then
    comthinktime=1
    	if computer[computer.line-1].direction==2 then
    	computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end
    n=1
    end
    
    if computer.direction==2 and comthinktime>speed and (computer.x +computer.width +speed> object.x) and (computer.y + computer.height > object.y) and (computer.y < object.y + object.height) then 
    comthinktime=1
    	if computer[computer.line-1].direction==1 then
    	computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end	
    n=1
    end
    
     
    if computer.direction==4 and comthinktime>speed and (computer.x-speed < object.x + object.width) and (computer.y + computer.height > object.y) and (computer.y < object.y + object.height) then
    comthinktime=1
    	if computer[computer.line-1].direction==1 then
    	computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end	
    n=1
    end
    
    end
    
    if computer.direction==1 and computer.x<10 and computer.y<10 then
            comthinktime=1
            computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==4 and computer.x<10 and computer.y<10 then
            comthinktime=1
            computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==1 and computer.x>470 and computer.y<10 then
            comthinktime=1
            computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==2 and computer.x>470 and computer.y<10 then
            comthinktime=1
            computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==3 and computer.x<10 and computer.y>262 then
            comthinktime=1
            computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==4 and computer.x<8 and computer.y>262 then
            comthinktime=1
            computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==2 and computer.x>470 and computer.y>262 then
            comthinktime=1
            computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==3 and computer.x>470 and computer.y>262 then
            comthinktime=1
            computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    end
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    
    function computeraimovement()
    
    if computer.direction==1 then
    computer.y=computer.y-speed
    computer[computer.line].height=computer[computer.line].height+speed
    computer[computer.line].y=computer[computer.line].y-speed
    end
    
    if computer.direction==3 then
    computer.y=computer.y+speed
    computer[computer.line].height=computer[computer.line].height+speed
    end
    
    if computer.direction==2 then
    computer.x=computer.x+speed
    computer[computer.line].width=computer[computer.line].width+speed
    end
    
    if computer.direction==4 then
    computer.x=computer.x-speed
    computer[computer.line].width=computer[computer.line].width+speed
    computer[computer.line].x=computer[computer.line].x-speed
    end
    
    end
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    function computeraiwalls()
    
    if computer.direction==1 and computer.x<10 and computer.y<10 then
            comthinktime=1
            computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==4 and computer.x<10 and computer.y<10 then
            comthinktime=1
            computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==1 and computer.x>470 and computer.y<10 then
            comthinktime=1
            computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==2 and computer.x>470 and computer.y<10 then
            comthinktime=1
            computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==3 and computer.x<10 and computer.y>262 then
            comthinktime=1
            computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==4 and computer.x<10 and computer.y>262 then
            comthinktime=1
            computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==2 and computer.x>470 and computer.y>262 then
            comthinktime=1
            computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if computer.direction==3 and computer.x>470 and computer.y>262 then
            comthinktime=1
            computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
            end
    
    if (computer.direction==1 and computer.y<10) or (computer.direction==3 and computer.y>262) then
    rannumber=math.random(1,2)
    comthinktime=1
    	if rannumber==1 then
    	computer.direction=2
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=4
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end
    end
    
    if (computer.direction==4 and computer.x<10) or (computer.direction==2 and computer.x> 470) then
    rannumber=math.random(1,2)
    comthinktime=1
    	if rannumber==1 then
    	computer.direction=1
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	else
    	computer.direction=3
    	computer.line=computer.line+1
    	computer[computer.line]={x=computer.x,y=computer.y,width=5,height=5,direction=computer.direction}
    	end
    end
    	
    end
    -----------------------------------------------------------------------------------------------------------------
    function credits()
    
    screen:clear()
    
    tmv = 1
    
    credy = 272
    
    while true do
    pad=Controls.read()
    screen:clear()
    
    tmv = tmv + 1
    
    pad = Controls.read()
    
    	screen:blit(0,0,menumn)
    
    if credy > 80 then
    credy = credy - 0.5
    end
    
    screen:print(180, credy, "       Thank you for playing,", menoselcol)
    screen:print(187, credy + 10, "       Light Cycles Clone!", meselcol)
    screen:print(194, credy + 30, "Thanks to Homemister and PickDat for:", menoselcol)
    screen:print(186, credy + 40, "          LUA Player HM6", meselcol)
    screen:print(200, credy + 60, "         Developed by:", menoselcol)
    screen:print(215, credy + 70, "         Luke Ryan", meselcol)
    screen:print(185, credy + 90, "    Additional programing by:", menoselcol)
    screen:print(165, credy + 100, "               Code Red", meselcol)
    screen:print(165, credy + 120, "           Original release:", menoselcol)
    screen:print(173, credy + 130, "          www.psp-hacks.com", meselcol)
    screen:print(165, credy + 150, "              Created for:", menoselcol)
    screen:print(196, credy + 160, " PSP-HACKS Homebrew Compo 2008", meselcol)
    screen:print(173, credy + 180, "Press START to return", white)
    
    
    		if pad:start() then
    		gamestate=4
                    break
    		end
    
    	screen.waitVblankStart()
    	screen:flip()
    	n=1
    	oldpad=pad
    	end
    end
    ----------------------------------------------------------------------------------------
    -------custom soundtrack
    function CustomTracks()
    
    	if numberofsongs==nil then
    	track=3
    	loadsong=1
    	song = System.listDirectory("ms0:/PSP/MUSIC")
    	numberofsongs=table.getn(song)
    	end
    
    	if numberofsongs>2 then
    		if loadsong==1 then
    		System.currentDirectory("ms0:/")
    		Mp3me.load("PSP/MUSIC/"..song[track].name)
    		Mp3me.play()
    		loadsong=0
    		end
    
    		if Mp3me.eos()==true then
    			if track<numberofsongs then
    			track=track+1
    			else
    			track=3
    			end
    		Mp3me.stop()
    		loadsong=1
    		end
    	else
    
    		if numberofsongs<3 or Mp3me.eos()==true then
    		Mp3me.load("song.mp3")
    		Mp3me.play()
    		end
    
    	end
    end
    
    -----------------------------------------------------------------------------------------------------------
    --music controls
    function musiccontrol()
    
    if pad:r() and oldpad:r()~=pad:r() then
    Mp3me.stop()
    	if track<numberofsongs then
    	track=track+1
    	else
    	track=3
    	end
    loadsong=1
    end
    
    if pad:l() and oldpad:l()~=pad:l() then
    Mp3me.stop()
    	if track>3 then
    	track=track-1
    	else
    	track=3
    	end
    loadsong=1
    end
    
    end
    ---------------------------------------------------------------------------------
    --main loop
    
    while true do
    screen:clear()
    
    CustomTracks()
    
    	if gamestate==0 then
    	menu()
    	end
    
    	if gamestate==1 then
    	oneplayer()
    	end
    
    	if gamestate==2 then
    	twoplayer()
    	end
    
    	if gamestate==3 then
    	credits()
    	end
    
    	if gamestate==4 then
    	mainmenu()
    	end
    
    screen.waitVblankStart()
    screen:flip()
    end

  14. #14
    Lua guy
    Points: 10,655, Level: 68
    Level completed: 52%, Points required for next Level: 195
    Overall activity: 0%

    Join Date
    Jan 2008
    Location
    Wales, cardiff
    Posts
    1,442
    QJ Pts
    10,655
    Level
    68
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Default

    Wow, so many IFs Nice i see who you do the music player Nice:)

  15. #15
    QJ Gamer Blue
    Points: 4,315, Level: 41
    Level completed: 83%, Points required for next Level: 35
    Overall activity: 0%

    Join Date
    Jul 2006
    Posts
    87
    QJ Pts
    4,315
    Level
    41
    Downloads
    0
    Uploads
    0

    Default

    thanks buddy. feel free to use it. just credit me somewhere.

  16. #16
    Lua guy
    Points: 10,655, Level: 68
    Level completed: 52%, Points required for next Level: 195
    Overall activity: 0%

    Join Date
    Jan 2008
    Location
    Wales, cardiff
    Posts
    1,442
    QJ Pts
    10,655
    Level
    68
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by titch.ryan View Post
    thanks buddy. feel free to use it. just credit me somewhere.
    ok, thanks man

  17. #17
    Points: 2,052, Level: 27
    Level completed: 35%, Points required for next Level: 98
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Join Date
    Dec 2008
    Posts
    1
    QJ Pts
    2,052
    Level
    27
    Downloads
    0
    Uploads
    0

    Default

    You wouldn't happen to be able to tell me how to replace the .lua file, would you? I am a tenderfoot in programming and can't figure out how to do as such. so please disregard if I'm begging and point out a program or site you might know of please.

  18. #18
    QJ Gamer Bronze
    Points: 4,840, Level: 44
    Level completed: 45%, Points required for next Level: 110
    Overall activity: 0%

    Join Date
    Aug 2007
    Location
    Australia
    Posts
    659
    QJ Pts
    4,840
    Level
    44
    Downloads
    0
    Uploads
    0

    Default

    Find the file called 'script.lua' and open it up in notepad. Then do ctrl+a, delete and copy and paste the code from the spoiler in titch.ryan's post into it and save

  19. #19
    QJ Gamer Gold
    Points: 17,453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Join Date
    Jul 2005
    Location
    everywhere
    Posts
    3,526
    QJ Pts
    17,453
    Level
    84
    Downloads
    1
    Uploads
    0

    Default

    Quote Originally Posted by PhonicUK View Post
    I'm just picking on you, my point being that teenagers typically don't have the same level of patience. :P

    I'm glad I'm 21, I can pick on teenagers now!
    that's pretty presumptuous of teenagers, i waited 2 years for mass effect to come out and i'm only 17
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  20. #20
    QJ Gamer Silver
    Points: 8,667, Level: 62
    Level completed: 73%, Points required for next Level: 83
    Overall activity: 0%

    Join Date
    Sep 2007
    Location
    AUS
    Posts
    282
    QJ Pts
    8,667
    Level
    62
    Downloads
    0
    Uploads
    0

    Default

    Hey titch.ryan,
    Do you want me to convert this to the LPHMv2 API?

    BTW this is an awesome game. Love the ingame music.
    Wyvern. That is all

  21. #21
    QJ Gamer Green
    Points: 2,859, Level: 32
    Level completed: 73%, Points required for next Level: 41
    Overall activity: 0%

    Join Date
    Dec 2007
    Posts
    19
    QJ Pts
    2,859
    Level
    32
    Downloads
    0
    Uploads
    0

    Default

    Code:
    ERROR: Script.LUA:855: attempt to compare number with nil
    Press start to restart
    replace with provided here script
    Code:
    Error: SCRIPT.LUA:849: bad argument #1 to 'getn' (table expected, got nil)
    Press start to restart
    what's wrong?
    cfw 5.00-4
    -------------------
    Fixed.
    I don't have MUSIC folder in PSP, it placed on root.
    Editing script have success.

    Thanks for that nice game ;)
    Last edited by ericbravo; 12-23-2008 at 12:11 PM.


 

Tags for this Thread

Posting Permissions

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





All times are GMT -8. The time now is 05:37 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2013, Caputo Media, LLC. All Rights Reserved. Cluster C5.
Contact Us | Free Flash Games | Ad Blockers Suck! Why?