Search found 30 matches

by lachlaan
Mon Jan 20, 2014 8:44 pm
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 25303

Re: Collision detection without physics?

I'd suggest giving every entity a hitbox and checking out http://www.love2d.org/wiki/BoundingBox.lua for lightweight collision detection. Should be what you need. Alternatively check how they do it and implement it yourself with circular hitboxes for more accuracy when it comes to dealing damage and...
by lachlaan
Sun Jan 19, 2014 6:52 pm
Forum: Support and Development
Topic: Tweening problem
Replies: 1
Views: 695

Re: Tweening problem

I had a look at it for the sake of remembering how to troubleshoot anything, and it turns out that when you initialize self.bg it becomes the same table as self._bg[1] , and after that everywhere it gets changed from reddish to blueish/greenish it also changes the value of self._bg[1].
by lachlaan
Mon Jan 13, 2014 4:49 am
Forum: Support and Development
Topic: draw
Replies: 1
Views: 1050

Re: draw

Could make a variable that toggles whenever the W key is down. The way you're doing it doesn't seem to allow for much else if W is pressed. Might want to have a look at checking for keypresses individually and triggering each key's action individually. Create a variable called wdown = false in love....
by lachlaan
Wed Oct 02, 2013 10:24 am
Forum: Support and Development
Topic: Get velocity of mouse
Replies: 24
Views: 7574

Re: Get velocity of mouse

Ultimately if you like how it works in your last implementation it's your choice to keep it that way. But bear in mind that there are several issues with that implementation in terms of actual realism. If you hold down the mouse for 10 minutes then drag the cube by moving your mouse at the speed of ...
by lachlaan
Sun Sep 29, 2013 12:22 pm
Forum: Support and Development
Topic: Rotating in love.graphics.rectangle [SOLVED]
Replies: 5
Views: 2745

Re: Rotating in love.graphics.rectangle

The first thing that pops to mind is drawing it to a canvas then drawing the canvas rotated, but hopefully some of the older lovers know of better methods.
by lachlaan
Fri Sep 27, 2013 5:05 pm
Forum: Support and Development
Topic: How to programatically close the game?
Replies: 11
Views: 6120

Re: How to programatically close the game?

If you made the menu run inside a while, and closed that while, would the program not just end because it executed all of the code? Actually curious about this, would there still be something running that you'd need to close specifically with the quit event?
by lachlaan
Wed Sep 25, 2013 11:28 am
Forum: Support and Development
Topic: Get velocity of mouse
Replies: 24
Views: 7574

Re: Get velocity of mouse

To make the speed a bit less spikey you could always average up the speed of the last few frames together.
by lachlaan
Tue Sep 24, 2013 10:02 am
Forum: Support and Development
Topic: Hit Score count-down
Replies: 3
Views: 1241

Re: Hit Score count-down

Not sure exactly what you mean, but if you want to log every individual time the rectangles overlap, regardless of the duration of overlapping, you could log when they switch states. You could try something like this : http://pastebin.com/n9xzPCa8 Where the overlapping function is whatever you're us...
by lachlaan
Mon Sep 23, 2013 8:14 pm
Forum: Support and Development
Topic: How to programatically close the game?
Replies: 11
Views: 6120

Re: How to programatically close the game?

Alternatively, you could have your various in-game levels running in separate while loops. One for menu, one for actual game and so on. And simply set all the while conditions to false when you push the right button.
by lachlaan
Sun Jun 30, 2013 7:28 pm
Forum: General
Topic: Need help on making my animated player do other thing!!!
Replies: 3
Views: 1755

Re: Need help on making my animated player do other thing!!!

If you're talking about your player.animreset function, then it might just be a matter of you not actually calling the function in the first place, perhaps.