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 )
[library] bump.lua v3.1.4 - Collision Detection
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
When I write def I mean function.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
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.
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
That was it! Fixed it all up and put it in Game:enter, problem solved! Thanks!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 )
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
Just a thought: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.
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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
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.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.
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.
When I write def I mean function.
- NightKawata
- Party member
- Posts: 294
- Joined: Tue Jan 01, 2013 9:18 pm
- Location: Cyberspace, Room 6502
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.kikito wrote: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.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.
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.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
The day you implement something slope related is the day you become my hero.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.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
Sorry, that was a typo, I meant "slide".NightKawata wrote:Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.
When I write def I mean function.
- NightKawata
- Party member
- Posts: 294
- Joined: Tue Jan 01, 2013 9:18 pm
- Location: Cyberspace, Room 6502
- Contact:
Re: [library] bump.lua v3.1.4 - Collision Detection
kikito wrote:Sorry, that was a typo, I meant "slide".NightKawata wrote:Is "slice" one of the new modes? That one sounds pretty interesting, or I'm just out of the bump update cycle.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
Re: [library] bump.lua v3.1.4 - Collision Detection
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.
Who is online
Users browsing this forum: No registered users and 0 guests