Search found 20 matches

by Bya
Mon Sep 15, 2014 11:38 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 417757

Re: "Questions that don't deserve their own thread" thread

I'm trying to make a "hitbox" for my character's attack (making a platformer). I want the hitbox object to "follow" the player and be "bound" to it, but I'm not entirely sure how to do that. My player is coded as follows player = {} player.b = love.physics.newBody(world...
by Bya
Thu Sep 11, 2014 4:54 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 417757

Re: "Questions that don't deserve their own thread" thread

You can't, not really. You'll have to delay it manually: maxTime = 0.2 curTime = 0 function love.update( dt ) curTime = curTime + dt if curTime > maxTime then -- go to the next step of your animation curTime = curTime - maxTime -- for smoothness, don't just go back to 0 end end Incidentally, this i...
by Bya
Tue Sep 09, 2014 1:51 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 417757

Re: "Questions that don't deserve their own thread" thread

I can't get animations to work either with AnAL or anim8, so I decided I would just manually swap out images, which is working fine, except I can't figure out how to "delay" the image change instead of it being what I assume is an instantaneous swap. How would I go about delaying it?
by Bya
Tue Sep 09, 2014 1:50 pm
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2936

Re: How to tell if certain objects are colliding/hitboxes?

That worked perfectly, thank you!
by Bya
Tue Sep 09, 2014 12:35 pm
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2936

Re: How to tell if certain objects are colliding/hitboxes?

I can't really do a detailed debug right now, but you are aware that images are by default drawn with their X,Y in the top-left corner, while physics bodies by default are calculated with X,Y as the center of the hitbox? This is something that will cause the sort of things that you're seeing right ...
by Bya
Tue Sep 09, 2014 12:08 pm
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2936

Re: How to tell if certain objects are colliding/hitboxes?

I've actually been able to determine whether or not the two objects are colliding by the following code: function beginContact(a, b, coll) if a == player.f then --text = text.."?????" if b == enemy.f then text = text.."CONTACT" end end x,y = coll:getNormal() text = text.."\n...
by Bya
Tue Sep 09, 2014 10:21 am
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2936

How to tell if certain objects are colliding/hitboxes?

Hey there, I have two problems that I've been trying to figure out so far. I've got a player character who is input controlled, and an "enemy" character who is "built" the same way as the player character. I used the CollisionCallback Physics tutorial on the main page, and while ...
by Bya
Mon Sep 08, 2014 12:56 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 417757

Re: "Questions that don't deserve their own thread" thread

Trying to get collision working in my game, I've been using the PhysicsCallback tutorial. It tells me when any objects collide with each other, but I want a function that checks to see when two specific objects collide, so I coded the two functions "beginPlayerEnemyContact" and "endPl...
by Bya
Sat Sep 06, 2014 4:29 am
Forum: Support and Development
Topic: Using a pre-existing image instead of drawing one.
Replies: 2
Views: 955

Using a pre-existing image instead of drawing one.

Hey all, I'm getting started with Love2D for the first time, and I was following a tutorial that would have me "control" a small red ball. However, I wish to use a pre-existing image. How would I go about doing this? The code in my main.lua is as follows function love.load() --player = lov...