Collision border problem within my game.

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.
dsk031
Prole
Posts: 12
Joined: Tue Dec 21, 2021 1:52 pm

Re: Collision border problem within my game.

Post by dsk031 »

pgimeno wrote: Thu Dec 23, 2021 4:10 pm I've found the source here: https://github.com/games50/pong/blob/ma ... n.lua#L105

The function isn't finished at that point; it keeps going. The end of the function is at line 175.
Holy crap, I just fixed it by looking at this code... I removed a function that was not there in the code that you just posted..

This function is not there on this block of code that you provided from Git... Once I removed I fixed the collision problem... You are a lifesaver :) thank you and much appreciated..

Code: Select all

--REMOVED this function-- function love.update(dt)
	-- player 1 movement
	if love.keyboard.isDown('w') then
		-- add negative paddle speed to current Y scaled by deltaTime
		player1.dy = -PADDLE_SPEED
	elseif love.keyboard.isDown('s') then
		-- add positive paddle to current Y scaled by deltaTime
		player1.dy = PADDLE_SPEED
	else
		player1.dy = 0
	end

    -- player 2 movement
	if love.keyboard.isDown('up') then
		-- add negative paddle speed to current Y scaled by deltaTime
		player2.dy = -PADDLE_SPEED
	elseif love.keyboard.isDown('down') then
		-- add positive paddle to current Y scaled by deltaTime
		player2.dy = PADDLE_SPEED
	else
		player2.dy = 0
	end
dsk031
Prole
Posts: 12
Joined: Tue Dec 21, 2021 1:52 pm

Re: Collision border problem within my game.

Post by dsk031 »

His block of code for movement has that function removed as well, can't believe I missed that... Bug fixing is tons of fun :sarcasm:
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], swuare and 6 guests