KaboomPSP 0.1

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Dark Killer
Posts: 32
Joined: Tue Jan 25, 2005 3:10 am

KaboomPSP 0.1

Post by Dark Killer »

my first psp game and also the first thing I've ever coded in LUA. KaboomPSP is a clone of the Atari 2600 game Kaboom.

http://www.sendmefile.com/00046899

sorry for having to use a free host but im probably the only coder without webspace :p
emumaniac
Posts: 79
Joined: Sun May 08, 2005 12:22 am

Post by emumaniac »

Hi nice release, ive took the liberty of uploading your release and mirroring it here --> http://www.dcemu.co.uk/vbulletin/showthread.php?t=9284

If your looking for a place to upload my forums can take up to 8 meg in zip file uploading. At least then you want have to use those horid free webservers. heres the link to the forum where we host projects --> http://www.dcemu.co.uk/vbulletin/forumdisplay.php?f=84

Also included a v1.0 eboot and added it to your zipfile.
Dark Killer
Posts: 32
Joined: Tue Jan 25, 2005 3:10 am

Post by Dark Killer »

i'm having a little problem that for the life of me I cant figure out the cause of: after 25 execution loops luaplayer returns an error at line 26 due to a stack overflow. here's the code, hopefully someone could show me what's causing this and how to resolve it.

Code: Select all

--[[
KaboomPSP, Copyright (c) 2005 Dark Killer
]]

-- load images
background = Image.load("bg.png")
title = Image.load("title.png")
bar = Image.load("bar.png")
bomb = Image.load("bomb.png")

function movebomb()
	by=by+2
end

function newbomb()
	--bomb:clear(green)
	--bomb = Image.load("bomb.png")
	--math.randomseed(os.time())
	by = 25
	math.randomseed(os.time())	
	bx = math.random(220)
end

function Control()
	--screen.waitVblankStart()
	pad = Controls.read()
	if pad:left() then
		x = x - 9
	elseif pad:right() then
		x = x + 9
	elseif x<1 then
		x=1
	elseif pad&#58;circle&#40;&#41; then
		screen&#58;save&#40;"screenshot.tga"&#41;
	end
	main&#40;&#41;
end

function main&#40;&#41;
	screen&#58;blit&#40;0, 0, background, 0, 0, background&#58;width&#40;&#41;, background&#58;height&#40;&#41;, false&#41;
	screen&#58;print&#40;280, 5, "Score&#58; " .. pnts, green&#41;
	screen&#58;blit&#40;bx, by, bomb&#41;
	screen&#58;blit&#40;x, 237, bar&#41;
	
	if bx + 50 >= x and bx + 50 <= x + 94 then
		if by + 50 >= 237 and by + 50 <= 256 then
			pnts = pnts + 100
			newbomb&#40;&#41;
		end	
	elseif by > 250 then
		if pnts >= 100 then
			pnts = pnts - 100
		end
			newbomb&#40;&#41;
		
	end
		
				


	movebomb&#40;&#41;
	screen.waitVblankStart&#40;&#41;
	screen.flip&#40;&#41;
	Control&#40;&#41;
end

screen&#58;blit&#40;0, 0, title, 0, 0, title&#58;width&#40;&#41;, title&#58;height&#40;&#41;, false&#41;
screen.waitVblankStart&#40;&#41;
screen.flip&#40;&#41;
screen.waitVblankStart&#40;141&#41;
green = Color.new&#40;0, 255, 0&#41;
x=2
pnts=0
newbomb&#40;&#41;
main&#40;&#41;
alex_dsnews
Posts: 13
Joined: Wed Aug 03, 2005 9:48 pm

Post by alex_dsnews »

It probably won't help, but you don't need math.randomseed(os.time()) every loop, just once per program run is enough.
Dark Killer
Posts: 32
Joined: Tue Jan 25, 2005 3:10 am

Post by Dark Killer »

thanks for the tip alex but, like I expected, it didnt solve my problem. I sure hope someone can help me because I've tried everything and I'd really hate to have to abandon development on this game.
Dark Killer
Posts: 32
Joined: Tue Jan 25, 2005 3:10 am

Post by Dark Killer »

Update: I finally got the stack overflow bug fixed so everyone can expect an update laster tonight :)
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

I suspect your problem was that main() calls control() and control in turn calls main? :)
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
Dark Killer
Posts: 32
Joined: Tue Jan 25, 2005 3:10 am

Post by Dark Killer »

ector wrote:I suspect your problem was that main() calls control() and control in turn calls main? :)
exactly.

anyway, here's 0.2 with some fixes and gameplay improvements:

http://rapidshare.de/files/4020201/Kabo ... K.zip.html
emumaniac
Posts: 79
Joined: Sun May 08, 2005 12:22 am

Post by emumaniac »

file mirrored here for those that cant download off the free server

http://psp-news.dcemu.co.uk/kaboompsp.shtml
Post Reply