Skip to content

Commit 738d0d3

Browse files
Added the death orb
I have now added all objects from the game to fyre. I just need to finish the color trigger now. (I don't want to)
1 parent 44764d1 commit 738d0d3

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

57.8 KB
Loading

src/game/object_types.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ pub fn create_object_types(
8585
)
8686
);
8787

88+
obj_types.insert(
89+
26,
90+
block_on(
91+
ObjectType::new(
92+
26,
93+
"Death Orb",
94+
"./Resources/objects/orbs/death-orb.png",
95+
obj_btn_offset,
96+
obj_types.len() as u16
97+
)
98+
)
99+
);
100+
88101
obj_types.insert(
89102
5,
90103
block_on(

src/game/playing/hitboxes.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn hitbox_collision(
133133
}
134134
}
135135

136-
4 | 22 => {
136+
4 | 22 | 26 => {
137137
if centered_player.overlaps(&Rect {
138138
x: object.x as f32 - 10.0 - world_offset,
139139
y: object.y as f32 - 10.0 - player_cam_y as f32,
@@ -157,6 +157,8 @@ pub fn hitbox_collision(
157157
gravity.set(default_gravity);
158158
jump_force.set(default_jump_force)
159159
}
160+
} else if object.id == 26 {
161+
*kill_player = true
160162
}
161163
*on_orb = false
162164
}

0 commit comments

Comments
 (0)