Search found 6 matches

by bandi72006
Fri Aug 09, 2019 11:19 am
Forum: Support and Development
Topic: "Attempt to compare number with nil" error with collision
Replies: 9
Views: 9054

Re: "Attempt to compare number with nil" error with collision

Holy heck I didn't see that.. THANKS SOOO MUCH!!

I knew it was a stupid mistake but it cost me 2 days of doing nothing!!!
by bandi72006
Thu Aug 08, 2019 11:11 am
Forum: Support and Development
Topic: "Attempt to compare number with nil" error with collision
Replies: 9
Views: 9054

Re: "Attempt to compare number with nil" error with collision

Here is the asteroid.lua: Asteroid = Class{} function Asteroid:init() self.x = 1280 self.y = love.math.random(0,wHeight) self.dx = 0 self.image = love.graphics.newImage("Asteroid.png") self.dx = love.math.random(5,100) self.width = self.image:getWidth() self.height = self.image:getHeight()...
by bandi72006
Thu Aug 08, 2019 4:49 am
Forum: Support and Development
Topic: "Attempt to compare number with nil" error with collision
Replies: 9
Views: 9054

Re: "Attempt to compare number with nil" error with collision

Also, the reason why it's called paddle in Player.lua and asteroid in main.lua is because I used the collision code from another project, and when I changed the paddle to asteroid, I thought that was the problem, so I left it as it is. I set the function to love.event.quit() just so I know that the ...
by bandi72006
Thu Aug 08, 2019 4:47 am
Forum: Support and Development
Topic: "Attempt to compare number with nil" error with collision
Replies: 9
Views: 9054

Re: "Attempt to compare number with nil" error with collision

Well this is all the stuff I have in my main.lua: Class = require "Class" require "Player" require "Asteroid" FORCE = 0.2 BACKGROUND = love.graphics.newImage("background.png") local SCROLL_SPEED = 5 local SCROLL = 1940 function love.load() love.window.setTitle...
by bandi72006
Wed Aug 07, 2019 5:22 pm
Forum: Support and Development
Topic: "Attempt to compare number with nil" error with collision
Replies: 9
Views: 9054

"Attempt to compare number with nil" error with collision

Hello guys, I'm quite new to programming in LÖVE 2D and Lua and I started coding my first game on it. Everything was running smoothly until I added collision to my game. It now gives me this error: Player.lua:13: attempt to compare number with nil. I know I somehow made a stupid mistake but I'm just...