Iron out wrinkles with one way platforms
parent
8ad6d20fbd
commit
dd26d1f093
|
@ -132,12 +132,10 @@ pub fn collide(this: @This(), body: BodyInfo) CollisionInfo {
|
||||||
const tilex = @intToFloat(f32, i * tile_width);
|
const tilex = @intToFloat(f32, i * tile_width);
|
||||||
const tiley = @intToFloat(f32, a * tile_height);
|
const tiley = @intToFloat(f32, a * tile_height);
|
||||||
const bottom = @floatToInt(i32, bot_right[1]);
|
const bottom = @floatToInt(i32, bot_right[1]);
|
||||||
|
const foot = body.rect.pos[1] + body.rect.size[1];
|
||||||
|
|
||||||
if (isOneWay(tile)) {
|
if (isOneWay(tile)) {
|
||||||
// const last = @floatToInt(i32, body.last[1]);
|
if (!body.is_passing and a == bottom and body.last[1] <= body.next[1] and foot < tiley + 2) {
|
||||||
// const next = @floatToInt(i32, body.next[1]);
|
|
||||||
// w4.tracef("%d, %d, %d", last, next, a * tile_height);
|
|
||||||
if (!body.is_passing and a == bottom and body.last[1] <= body.next[1]) {
|
|
||||||
collisions.append(util.AABB{
|
collisions.append(util.AABB{
|
||||||
.pos = Vec2f{tilex, tiley},
|
.pos = Vec2f{tilex, tiley},
|
||||||
.size = tile_sizef,
|
.size = tile_sizef,
|
||||||
|
|
Loading…
Reference in New Issue