Page 13 of 23
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Tue Oct 13, 2015 8:17 pm
by kikito
mm.
As I imagined, you are quite confused
The main problem is that you are creating all the tiles every time you draw. That is not necessary.
Create them once at the beginning - for example inside game:enter. On the draw, just draw. Don't create anything.
Edit: Also, just to clarify: bump is not part of hump (you put it inside, and it took me a while to find out where it was
)
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Tue Oct 13, 2015 8:49 pm
by Jasoco
Well I decided to try and implement a slope method I had been thinking of for a while just to see if it worked...
It doesn't really.
Basically i just created 16 separate collision objects with a type of "slope", one for each pixel of a tile size, and when the player detects one on its X normal it just moves the Y position up 1.
Sadly it doesn't work as well as I thought. At least not this way.
I'd really rather just have an official method using that method you were working on a while ago. I don't even know how I'd make this work from here.
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Tue Oct 13, 2015 9:12 pm
by TheMeq
kikito wrote:mm.
As I imagined, you are quite confused
The main problem is that you are creating all the tiles every time you draw. That is not necessary.
Create them once at the beginning - for example inside game:enter. On the draw, just draw. Don't create anything.
Edit: Also, just to clarify: bump is not part of hump (you put it inside, and it took me a while to find out where it was
)
That was it! Fixed it all up and put it in Game:enter, problem solved! Thanks!
Also, I know bump isn't part of hump, I just dropped it in there so the libraries are all together, just not renamed my libraries folder yet
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Tue Oct 13, 2015 10:15 pm
by davisdude
Jasoco wrote:Basically i just created 16 separate collision objects with a type of "slope", one for each pixel of a tile size, and when the player detects one on its X normal it just moves the Y position up 1.
Sadly it doesn't work as well as I thought. At least not this way.
Just a thought:
You could make the player's movement a vector, and project that vector onto a vector of the slope of the tile, and move the player up that vector. I think this would work, although you might encounter some problems if you have different slopes or something.
Again, this may (probably) won't work, but you could give it a try.
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Tue Oct 13, 2015 11:58 pm
by kikito
Jasoco wrote:
I'd really rather just have an official method using that method you were working on a while ago. I don't even know how I'd make this work from here.
Yeah, it's on my todo list. I wanted to do it during the Summer, but I changed to a new job which has required all my programming juices for a while. It's a bit better now, so I have been able to start working on pending issues, pull requests, etc, on several of my projects.
I don't enjoy working in bump that much
. Since I am not particularly math-inclined, every time I need to program mathy stuff I get quite frustrated. So I have to gather my energies first. But I did not forget about the slopes.
Also, one month ago I started playing XCOM: The Long War. OMG it's so good
EDIT: to recall: My idea was adding 4 new "collision types". In addition of "slice", "cross", etc, you would have "◢", "◣", "◤" and "◥" (the unicode name is provisional). In theory, it's as simple as writing 4 new functions. In theory.
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Wed Oct 14, 2015 12:28 am
by NightKawata
kikito wrote:Jasoco wrote:
I'd really rather just have an official method using that method you were working on a while ago. I don't even know how I'd make this work from here.
Yeah, it's on my todo list. I wanted to do it during the Summer, but I changed to a new job which has required all my programming juices for a while. It's a bit better now, so I have been able to start working on pending issues, pull requests, etc, on several of my projects.
I don't enjoy working in bump that much
. Since I am not particularly math-inclined, every time I need to program mathy stuff I get quite frustrated. So I have to gather my energies first. But I did not forget about the slopes.
Also, one month ago I started playing XCOM: The Long War. OMG it's so good
EDIT: to recall: My idea was adding 4 new "collision types". In addition of "slice", "cross", etc, you would have "◢", "◣", "◤" and "◥" (the unicode name is provisional). In theory, it's as simple as writing 4 new functions. In theory.
Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Wed Oct 14, 2015 3:01 am
by Jasoco
kikito wrote:EDIT: to recall: My idea was adding 4 new "collision types". In addition of "slice", "cross", etc, you would have "◢", "◣", "◤" and "◥" (the unicode name is provisional). In theory, it's as simple as writing 4 new functions. In theory.
The day you implement something slope related is the day you become my hero.
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Wed Oct 14, 2015 6:49 am
by kikito
NightKawata wrote:Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.
Sorry, that was a typo, I meant "slide".
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Fri Oct 16, 2015 7:13 pm
by NightKawata
kikito wrote:NightKawata wrote:Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.
Sorry, that was a typo, I meant "slide".
Re: [library] bump.lua v3.1.4 - Collision Detection
Posted: Fri Oct 23, 2015 8:48 pm
by Kasperelo
So, if I want to add enemies to my game, I add them to the world, but what do I do if I want the player to be able to pass through the enemy? Of course I want them both to collide with the other objects in the world.