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 .
gravyferry
Prole
Posts: 11 Joined: Sat May 30, 2015 11:15 pm
Post
by gravyferry » Sat Jun 20, 2015 12:08 am
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 156 times
davisdude
Party member
Posts: 1154 Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina
Post
by davisdude » Sat Jun 20, 2015 12:56 am
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
TurtleP
Party member
Posts: 147 Joined: Thu Mar 22, 2012 9:20 pm
Contact:
Post
by TurtleP » Sat Jun 20, 2015 1:01 am
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!
zorg
Party member
Posts: 3468 Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:
Post
by zorg » Sat Jun 20, 2015 1:36 am
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.
Last edited by
zorg on Sat Jun 20, 2015 6:32 am, edited 1 time in total.
Me and my stuff True 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.
TurtleP
Party member
Posts: 147 Joined: Thu Mar 22, 2012 9:20 pm
Contact:
Post
by TurtleP » Sat Jun 20, 2015 2:09 am
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
Post
by gravyferry » Sat Jun 20, 2015 2:27 am
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.
Users browsing this forum: Ahrefs [Bot] , Bing [Bot] and 4 guests