Page 1 of 1

Function argument expected ','

Posted: Sat Jun 20, 2015 12:08 am
by gravyferry
I don't know what i've done here that doesnt work, I have an if function argument on the line that it's talking about.

Code: Select all

	-- Collision detection
	if checkCollision(bullet.x, bullet.y, bullet.Img:getWidth(), bullet.Img:getHeight, player.x, player.y, player.Img:getWidth(), player.Img:getHeight()) then
		player.x = player.x + (10000)
		isAlive = false
	end	   	
	
	if checkCollision(bullet.x, bullet.y, bullet.Img:getWidth(), bullet.Img:getHeight, player2.x, player2.y, player2.Img:getWidth(), player2.Img:getHeight()) then
		player2.x = player2.x + (10000)
		enemyAlive = false
	end	
end
the line it's talking about it the one directly under where it says collision detection.

edit: forgot the .love file

Re: Function argument expected ','

Posted: Sat Jun 20, 2015 12:56 am
by davisdude
In both you're missing the () on the fist Img:getHieght. I can't test right now, but that may be the problem.

Re: Function argument expected ','

Posted: Sat Jun 20, 2015 1:01 am
by TurtleP
davisdude wrote:In both you're missing the () on the fist Img:getHieght. I can't test right now, but that may be the problem.
Not just on the first, but the second. It's always good to have a second pair of eyes look at this stuff! ;)

Re: Function argument expected ','

Posted: Sat Jun 20, 2015 1:36 am
by zorg
TurtleP wrote:Not just on the first, but the second. It's always good to have a second pair of eyes look at this stuff! ;)
davisdude wrote:In both you're missing the () on the fist Img:getHieght. I can't test right now, but that may be the problem.
:3

Re: Function argument expected ','

Posted: Sat Jun 20, 2015 2:09 am
by TurtleP
zorg wrote:
TurtleP wrote:Not just on the first, but the second. It's always good to have a second pair of eyes look at this stuff! ;)
davisdude wrote:In both you're missing the () on the fist Img:getHieght. I can't test right now, but that may be the problem.
Well I seem to have misread that. My bad.

Re: Function argument expected ','

Posted: Sat Jun 20, 2015 2:27 am
by gravyferry
davisdude wrote:In both you're missing the () on the fist Img:getHieght. I can't test right now, but that may be the problem.
Oh oops, didn't notice that, thanks for saying it, and thanks to you too TurtleP for still being considerate, even if you were wrong.