Search found 169 matches

by nice
Fri Jan 12, 2018 5:43 pm
Forum: General
Topic: [HELP]Rotating circles around the middle and not corner
Replies: 4
Views: 693

Re: [HELP]Rotating circles around the middle and not corner

If you insist on 0,0 being the center of the window: w, h = love.graphics.getDimensions() love.graphics.translate(w/2, h/2) Also, you probably should offset your circles by a half too: love.graphics.draw(circle, sunX, sunY, 0, 1, 1, circleW/2, circleH/2) Lastly it's always a good idea to program yo...
by nice
Fri Jan 12, 2018 5:40 pm
Forum: General
Topic: [HELP]Rotating circles around the middle and not corner
Replies: 4
Views: 693

Re: [HELP]Rotating circles around the middle and not corner

That it's rotating around the upper left corner is good because it's the origin(x=0 and y=0). Just translate the origin to the desired position the way you're doing it. Or if you wanna have rotation and translation in the same line: planetX = math.cos(angle) * rotation_radius + rotation_center_offs...
by nice
Fri Jan 12, 2018 2:41 pm
Forum: General
Topic: [HELP]Rotating circles around the middle and not corner
Replies: 4
Views: 693

[HELP]Rotating circles around the middle and not corner

Hello everyone! I'm currently making a "solarsystem" for fun and to get a better understanding of how Löve2D works. I've just hit a roadblock in where I try to make my planets rotate around a point that's supposed to be in the middle of the screen and for some reason the rotation is set in the upper...
by nice
Tue Oct 03, 2017 7:28 pm
Forum: General
Topic: [Help] Collision detection isn't working as it should
Replies: 2
Views: 506

Re: [Help] Collision detection isn't working as it should

crystal wrote:
Sun Oct 01, 2017 5:18 pm
replace your "distanceBetween" function with this
https://love2d.org/wiki/DistanceBasedCollision

and change this line to

Code: Select all

if distanceBetween(z.X, z.Y, player.X , player.Y,30,30) then
hope that helps ^^
I'll check it out when I have time
Thanks!
by nice
Sun Oct 01, 2017 12:43 pm
Forum: General
Topic: [Help] Collision detection isn't working as it should
Replies: 2
Views: 506

[Help] Collision detection isn't working as it should

Hello everyone! I'm currently following a tutorial to create a "Zombie-shooting-survival" game on Udemy that I think is kinda good. But I have a problem where my "zombies" are supposed to delete themselves when they collide with the player but sometimes it works but more than often it doesn't (the z...
by nice
Sat Jul 01, 2017 11:48 am
Forum: General
Topic: [help] with collision detection on a Pong remake.
Replies: 6
Views: 1217

Re: [help] with collision detection on a Pong remake.

Nevermind this part of the post, I moved "return ball" to the bottom of the script and at least it runs now Right now I'm attempting to use BoundingBox to try to collision and this is what I have right now: local Player = require("player") function love.load() Player:setup() end local ball = {} fun...
by nice
Sat Jul 01, 2017 9:17 am
Forum: General
Topic: [help] with collision detection on a Pong remake.
Replies: 6
Views: 1217

Re: [help] with collision detection on a Pong remake.

thedaemon wrote:
Fri Jun 30, 2017 9:36 pm
https://love2d.org/wiki/BoundingBox.lua

This is what I am using for my Pong game. It's a good basic start.
Thanks I'll take a look at it later, but how do I/does it determine the height and width of my object?
by nice
Fri Jun 30, 2017 8:49 pm
Forum: General
Topic: [help] with collision detection on a Pong remake.
Replies: 6
Views: 1217

[help] with collision detection on a Pong remake.

Hello everyone! This might be a lengthy read but there's things that I want to explain thoroughly so I thank you for your patience. :P I'm currently in the process of relearning/learning Löve2D/lua and to learn I'm remaking some older games and in this case: Pong. What I have so far So far I have tw...
by nice
Wed Mar 08, 2017 6:03 pm
Forum: Support and Development
Topic: Help: Advice on how to make my ball in Pong project "bounce"
Replies: 7
Views: 1258

Re: Help: Advice on how to make my ball in Pong project "bounce"

That's the field of collision and response. You need to detect collision and issue appropriate response action. You could use existing physics libraries for that, or do all the math yourself. Yeah I figured that collision detection will be the problem and Jasoco recommended that I look up Bump . I ...
by nice
Wed Mar 08, 2017 6:00 pm
Forum: Support and Development
Topic: Help: Advice on how to make my ball in Pong project "bounce"
Replies: 7
Views: 1258

Re: Help: Advice on how to make my ball in Pong project "bounce"

Look into Bump. It'll make it easier. Otherwise you'll have to do the math yourself. A bunch of if checks on the position of the ball and the paddle. I'll take a look at Bump but right now I think my problem is to know when my ball and paddle collide with eachother. I'm thinking something like "if ...