This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

I have a couple areas in my map that features an incline for a character to walk up. Not sure if this is in Impact Engine ( was unable to find the feature ). But how would I a make such a thing possible. I haven't started going into how I would create sloped tiles I figured I would ask if anyone else has a solution to this first.
I'm also interested in this.

The ideal situation that I can come up with is having collision tiles that abide by the alpha channel of the collision tile used (ie. Vehicle 2 has a backdrop and a collision layer), but it would have to account for the steepness of the slope so that movement over that tile doesn't look strange & items with a bounce coefficient could be rather difficult & what if someone wants to use curved slopes...

All of this being said; I haven't been able to look into this subject for myself, because my primary computer is away for repairs.
I've been doing a lot of research and trial and error work with sloped tiles recently. I haven't been able to get something I'm satisfied with yet, but I feel like I'm getting closer.

I've been using Entities to represent sloped tiles. This seems to be working but I have to do a lot of interesting things to the Player entity when it hits a sloped tile to make it "feel" right (like turn off gravity and velocity and manually adjust Player's position using a Bresingham's line algorithm, then turn it all back on when the Player has moved beyond the slope).

I think it&`039;d be ideal if entities could have #collision: ig.Entity.COLLIDES.SLOPE` with `slope: {x1: 0, y1: 0, x2: 32, y2: 32}` as a settable property (which would describe a 45 degree slope). Impact's Entity class could then use the entity's slope setting to figure out how to handle velocity, bounciness, and a new one: trajectory.

That said, I may dig into the collision code to see how this might work. But I recognize that it's complicated.

Some links to stuff I've been reading (all of which may be basic comp sci, physics 101 stuff, but all new to me):

velocity, friction, inclined planes
Bresenham's line
more line stuff
collisions with slopes
Here is some Flixel code for sloped tiles that might be helpful:

https://github.com/fefranca/FlxUtils/blob/master/com/fefranca/flixel/FlxTilemapSloped.as

Demo here: http://www.fefranca.com/experiments/flxslopes/
I know I'm digging up a really old thread, but if anyone is still looking for a way to make curved or sloped tiles, maybe this will help? http://nicolahibbert.com/curved-sloped-tiles-javascript-games/

I'll post some code for Impact as and when I get it implemented into my game.

Cheers! :)
That's a clever approach, I'm currently working on a top down that needs fancy lighting effects like the player has a torch etc. So I've been playing with modifying the alpha levels of background tiles.... this is a clever implementation for the collision level. I'd be interested to see how you approach it.
@MyShuitings - Me too! :P Hope we're not working on the same game ;)
@Hareesun - nah... I doubt it... I'm working on a straight up faithful to the original clone of Zelda Link to the Past for the SNES. The ides is to use it to develope a tone of awesome code, without worrying about or being limited by my creativity. Things like the lighting affect of the lantern and torches in the dungeons etc, the pathfinding of the badguys, inventory systems etc... Kinda a proof of concept that we can all take browser games to the next level.

Then I'll do something creative of my own I suppose.
PHEW. :P

We're safe... For now. ;) Sounds awesome though! Can't wait to see it :)
A great read overall (although it is older and uses Flash)

Here is the chapter on slopes which may provide some helpful info.
http://www.tonypa.pri.ee/tbw/tut24.html
I am interested also in advanced collision detection, be it by alpha chanell tile-based, or by drawing kind of vector mask inside a editor, perhaps ? Probably will eat more resources, but would be nice to have more complex tileset and perpixel collision!
This can basically be done already by having a specific collision tile assigned to diagonal movement. It just needs to push the player up and in the direction walking.

I plan on prototyping this idea soon. I’ll post with progress.
Normally, each tile is either completely solid, or intangible. But each tile could optionally access an array that gives more precise collision detection within that tile. In Weltmeister, imagine that among your collision tiles in the collision layer you have a few slopes. These could call the additional slope code.

Page 1 of 1
« first « previous next › last »