Search found 20 matches

by Bya
Sat Jan 03, 2015 12:28 am
Forum: Support and Development
Topic: Collision with only certain objects?
Replies: 12
Views: 6382

Re: Collision with only certain objects?

Oh, ok. What should I use instead of love.physics?
by Bya
Fri Jan 02, 2015 10:40 pm
Forum: Support and Development
Topic: Collision with only certain objects?
Replies: 12
Views: 6382

Re: Collision with only certain objects?

I haven't used love.physics very much, but don't you have to call setSensor() on your Shape instead of your Fixture? The Shape is the piece that has mass and controls collisions, right? I changed my line from swordhitbox.f:setSensor(playerhitboxsensor) to swordhitbox.f:setSensor(swordhitbox.s) And ...
by Bya
Fri Jan 02, 2015 10:02 pm
Forum: Support and Development
Topic: Collision with only certain objects?
Replies: 12
Views: 6382

Collision with only certain objects?

I had a previous thread here where I wanted to be able to find whether or not certain objects collide, but my current problem is a bit different. https://love2d.org/forums/viewtopic.php?f=4&t=78736 Right now, I have three entities, the player, an enemy, and a "hitbox". I want to be abl...
by Bya
Sun Oct 19, 2014 8:29 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411869

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

Oh, that's what I've been doing, but I figured there might be some easier way to do it like a .terminate function I was unaware of or something. Thanks though!
by Bya
Sun Oct 19, 2014 7:38 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411869

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

How would one delete an entity? Like, completely wipe it from the current game. I.e, once an enemy is defeated, to delete it completely so it doesn't show up, follow the player, do anything that it would normally do.
by Bya
Mon Sep 29, 2014 8:35 am
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8739

Re: Making a "hitbox" follow the player?

Yeah, there are two basic ways. The simple one is to turn the hitbox into a sensor: http://leafo.net/love/wiki/fixture_setsensor1.html This will make the hitbox not resolve collisions but it will still trigger callbacks (ie; you can detect when it hits and stops hitting something, but it won't push...
by Bya
Mon Sep 29, 2014 7:49 am
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8739

Re: Making a "hitbox" follow the player?

what about: function love.update(dt) swordhitbox.b:setPosition(player.b:getPosition()) end It's important that the position gets updated constantly. This worked! I have it set that the hitbox only sticks to the player when they hit the attack button, which works, but I didn't realize that having a ...
by Bya
Wed Sep 24, 2014 11:53 pm
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8739

Re: Making a "hitbox" follow the player?

My love file doesn't consist of anything other than my main lua file (below) and the sprites I need for the game. function love.load() playerimage = love.graphics.newImage("GraveStone.png") playerrun = love.graphics.newImage("KnightSprites/KnightRunRight.gif") playerattack = love...
by Bya
Tue Sep 23, 2014 9:23 pm
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8739

Re: Making a "hitbox" follow the player?

Blank wrote:I'm not too keen on how LUA works but this works in other languages. Couldn't you do--

Code: Select all

swordhitbox.x = player.x
swordhitbox.y = player.y
Yeah, I don't think that would really do anything. player.x and player.y are values that I actually forgot to remove a while ago.
by Bya
Tue Sep 23, 2014 3:56 am
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8739

Making a "hitbox" follow the player?

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...