QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

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

Reply
 
LinkBack Thread Tools
Old 06-25-2008, 09:54 AM   #1
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 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 10:24 AM..
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 09:59 AM   #2
 
J_C_103's Avatar
 
Join Date: Aug 2006
Location: New Jersey
Posts: 1,039
Trader Feedback: 0
Default

Wifi?
J_C_103 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 10:05 AM   #3
 
Join Date: Mar 2008
Posts: 261
Trader Feedback: 0
Default

3D lightcycles like in GLTron and WiFi multiplayer
PhonicUK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 10:09 AM   #4
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 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!
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 10:19 AM   #5
 
Maxy_PSP's Avatar
 
Join Date: Sep 2007
Location: BELGIUM !!
Posts: 234
Trader Feedback: 0
Default

Lua ?

Cyaa
Maxy_PSP is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 10:25 AM   #6
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 0
Default

yes it is lua
don't knock it till you've tried it lol
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 10:27 AM   #7
Banned for LIFE
 
Join Date: Oct 2006
Location: East London, England
Posts: 2
Trader Feedback: 0
Default

Interesting, i'll check it out

Last edited by eldiablov; 06-25-2008 at 10:41 AM..
eldiablov is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-26-2008, 04:11 AM   #8
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 0
Default

i'm now working on wifi, may take a while as i've never done it before.
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-26-2008, 05:50 AM   #9
 
Join Date: Mar 2008
Posts: 261
Trader Feedback: 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!
PhonicUK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-26-2008, 06:39 AM   #10
Enter Custom Title
 
dan369's Avatar
 
Join Date: Jan 2008
Real First Name: Dan
Location: Wales, cardiff
Just Played: Overlord 2
Posts: 1,308
Blog Entries: 1
Trader Feedback: 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
dan369 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-26-2008, 08:43 AM   #11
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 0
Default

18 next month so yes still a teenager i suppose.

glad you like it.
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-26-2008, 08:45 AM   #12
 
Join Date: Mar 2008
Posts: 261
Trader Feedback: 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!
PhonicUK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-27-2008, 01:49 AM   #13
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 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
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-27-2008, 01:54 AM   #14
Enter Custom Title
 
dan369's Avatar
 
Join Date: Jan 2008
Real First Name: Dan
Location: Wales, cardiff
Just Played: Overlord 2
Posts: 1,308
Blog Entries: 1
Trader Feedback: 0
Default

Wow, so many IFs Nice i see who you do the music player Nice
dan369 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-27-2008, 10:44 AM   #15
 
titch.ryan's Avatar
 
Join Date: Jul 2006
Posts: 87
Trader Feedback: 0
Default

thanks buddy. feel free to use it. just credit me somewhere.
titch.ryan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-27-2008, 12:28 PM   #16
Enter Custom Title
 
dan369's Avatar
 
Join Date: Jan 2008
Real First Name: Dan
Location: Wales, cardiff
Just Played: Overlord 2
Posts: 1,308
Blog Entries: 1
Trader Feedback: 0
Default

Quote:
Originally Posted by titch.ryan View Post
thanks buddy. feel free to use it. just credit me somewhere.
ok, thanks man
dan369 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2008, 02:48 PM   #17
 
Join Date: Dec 2008
Posts: 1
Trader Feedback: 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.
daveman0331 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2008, 02:56 PM   #18

Developer
 
Join Date: Aug 2007
Location: Australia
Posts: 657
Trader Feedback: 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
__________________
Xsjado7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2008, 06:30 PM   #19

Developer
 
slicer4ever's Avatar
 
Join Date: Jul 2005
Location: everywhere
Posts: 3,357
Trader Feedback: 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
slicer4ever is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2008, 11:30 PM   #20

Developer
 
homemister91's Avatar
 
Join Date: Sep 2007
Location: AUS
Posts: 281
Trader Feedback: 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.
__________________
Heres to the Wyvern,
Heres to getting Wyvern,
Heres to staying Wyvern,
And if you can't get Wyvern.......
You should become a kingsman!

http://arnold.hyperphp.com/ arnold, Light_AleX and my releases

homemister91 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-23-2008, 12:49 PM   #21
 
Join Date: Dec 2007
Posts: 19
Trader Feedback: 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 01:11 PM..
ericbravo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
clone , cycle , game , improved , light , lua , release , v21

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 06:18 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us