Search found 8 matches

by PenguinKing
Sun Feb 21, 2021 5:46 am
Forum: Support and Development
Topic: Loveframes checkboxes not allowing other checkboxes to be checked?
Replies: 2
Views: 2460

Loveframes checkboxes not allowing other checkboxes to be checked?

Summary: Essentially; I'm trying to create a bunch of textboxes with the loveframes library and for some reason whenever I click one of the checkboxes, I can no-longer click the other three. Problem: My problem is the fact that the clicked checkbox will un-check and check once more, however; I can ...
by PenguinKing
Thu Feb 18, 2021 9:00 am
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 7038

Re: How would one check if a square is within a circle?

I think your example code is fine. Just check the distance from the turret to the center of the enemy, there is no need to involve squares/rectangles. If you insist then here is the code: https://2dengine.com/?p=intersections#Circle_vs_rectangle To determine if the square is *entirely* inside the c...
by PenguinKing
Thu Feb 18, 2021 3:28 am
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 7038

Re: How would one check if a square is within a circle?

Hmm... I'm now sure I understand where you're coming from in terms of using pythag... I mean, I've used pythag quite a lot in the past, yet, this has been giving me a lot of trouble... Also, how would I check each corner of the square? (the square is going to be 8x8px)
by PenguinKing
Thu Feb 18, 2021 2:28 am
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 7038

How would one check if a square is within a circle?

Summary: I'm looking to implement some sort of Attack Radius system in my game that I've started working on recently, however; I'm not really sure how to implement such a thing... I don't really have any code on what I'm trying to do, but I've thrown something together in order to make it easier fo...
by PenguinKing
Wed Feb 17, 2021 11:27 pm
Forum: Support and Development
Topic: How to make an object rotate towards the mouse position.
Replies: 5
Views: 5226

Re: How to make an object rotate towards the mouse position.

I've looked at your code now and I think your problem is in turret.lua:18. You are needlessly converting radians to degrees. The draw function takes radians in the rotation parameter. number r (0) Orientation ( radians ). Works perfectly! Thanks for the help! Now that that's done I need to get the ...
by PenguinKing
Wed Feb 17, 2021 11:23 pm
Forum: Support and Development
Topic: How to make an object rotate towards the mouse position.
Replies: 5
Views: 5226

Re: How to make an object rotate towards the mouse position.

I have not looked at your code, but this works for me: local dx = game.mouseX - x local dy = -(game.mouseY - y) love.graphics.draw(image, x, y, math.atan2(dx, dy), 1, 1, image:getWidth() / 2, image:getHeight() / 2) I tried your suggestion and it didn't seem to do anything at all. Thanks for trying ...
by PenguinKing
Wed Feb 17, 2021 9:22 pm
Forum: Support and Development
Topic: How to make an object rotate towards the mouse position.
Replies: 5
Views: 5226

How to make an object rotate towards the mouse position.

Summary: Essentially, I've looked up several different ways to look this up and I get the gist of what's going on with the math.atan2 and various other ways of getting the angle to face towards the mouse position. Though; I'm still having a bit of trouble with trying to get the object to face compl...