Function argument expected ','

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
gravyferry
Prole
Posts: 11
Joined: Sat May 30, 2015 11:15 pm

Function argument expected ','

Post 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
Attachments
Archive.love
(5.54 KiB) Downloaded 135 times
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Function argument expected ','

Post 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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
TurtleP
Party member
Posts: 147
Joined: Thu Mar 22, 2012 9:20 pm
Contact:

Re: Function argument expected ','

Post 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! ;)
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Function argument expected ','

Post 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
Last edited by zorg on Sat Jun 20, 2015 6:32 am, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
TurtleP
Party member
Posts: 147
Joined: Thu Mar 22, 2012 9:20 pm
Contact:

Re: Function argument expected ','

Post 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.
gravyferry
Prole
Posts: 11
Joined: Sat May 30, 2015 11:15 pm

Re: Function argument expected ','

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 192 guests