Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
update: last
Browse files Browse the repository at this point in the history
  • Loading branch information
Lampese committed Nov 20, 2024
1 parent 6acd373 commit be291af
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions teams/汪汪立功/code/src/arrow.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn generate_arrow(
fn update_arrow(self : Room) -> Unit {
let erase_list : Array[UInt] = []
for id, arrow in self.arrows {
let hitbox = get_hitbox_f(arrow.pos,2.5)
let hitbox = get_hitbox_f(arrow.pos, 2.5)
let mut flag = false
if game.current_room.arrow_walls.shape_in_box(hitbox) {
erase_list.push(id)
Expand All @@ -74,7 +74,7 @@ fn update_arrow(self : Room) -> Unit {
flag = true
}
for _, enemy in self.enemys {
if get_hitbox_f(enemy.pos,5).intersect(hitbox) {
if get_hitbox_f(enemy.pos, 5).intersect(hitbox) {
enemy.hp -= arrow.damage
music_damage()
erase_list.push(id)
Expand Down
2 changes: 1 addition & 1 deletion teams/汪汪立功/code/src/game.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn update_level(self : Player) -> Unit {
}
}
game.current_room = generate_room(game.level)
game.pause_cd = CD::new(50 + game.level*2, 1)
game.pause_cd = CD::new(50 + game.level * 2, 1)
}
None => ()
}
Expand Down
2 changes: 1 addition & 1 deletion teams/汪汪立功/code/src/hitbox.mbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enum Shape {
Rect(Float,Float,Float,Float)
Rect(Float, Float, Float, Float)
}

struct HitBox {
Expand Down
2 changes: 1 addition & 1 deletion teams/汪汪立功/code/src/pos.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn distance(self : Position, other : Position) -> Float {
(self.y - other.y) * (self.y - other.y)).sqrt()
}

fn get_hitbox_f(self:Position,f:Float) -> Shape {
fn get_hitbox_f(self : Position, f : Float) -> Shape {
Rect(self.x - f, self.y - f, self.x + f, self.y + f)
}

Expand Down
5 changes: 2 additions & 3 deletions teams/汪汪立功/code/src/render.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ fn render(room : Room, player : Player) -> Unit {
if room.upgrade {
set_main_color_with_transparent(LightBrown)
render_upgrade_room()
}
else if room.start {
} else if room.start {
set_main_color_with_transparent(LightBrown)
render_start_room()
}
Expand Down Expand Up @@ -51,5 +50,5 @@ fn render_background() -> Unit {
set_draw_color(2, Brown)
set_draw_color(3, Grey)
set_draw_color(4, Black)
map_texture.render_texture(0,0)
map_texture.render_texture(0, 0)
}
1 change: 1 addition & 0 deletions teams/汪汪立功/code/src/room.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn Room::new(upgrade : Bool, start : Bool) -> Room {
start,
}
}

fn update_room(self : Room) -> Unit {
if self.stop.not() {
set_main_color_with_transparent(LightBrown)
Expand Down
Binary file modified teams/汪汪立功/game.wasm
Binary file not shown.

0 comments on commit be291af

Please sign in to comment.