Skip to content

Commit

Permalink
ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
eguneys committed Jan 3, 2024
1 parent 60c2944 commit fd75ea7
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/out_0.json

Large diffs are not rendered by default.

Binary file modified content/out_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/sprites/arrow_up_fire.ase
Binary file not shown.
Binary file added content/sprites/rank_2.ase
Binary file not shown.
37 changes: 37 additions & 0 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ export class RectView extends Play {
}
}


class ArrowUpFire extends Play {

v!: number


_init() {

let _ = this.make(Anim, Vec2.make(0, 0), {
name: 'arrow_up_fire'
})
_.play_o('idle', { loop: true })

this.v = 200 + Math.random() * 100

}


_update() {
this.position.x += this.v * 0.8 * Time.delta
this.position.y -= this.v * Time.delta
}
}

export class Background extends Play {
_init() {

Expand All @@ -72,6 +96,19 @@ export class Background extends Play {
h: Game.height,
color: Color.hex(0x222222)
})



}

_update() {

if (Time.on_interval(ticks.seconds * 3)) {
for (let i = 0; i < Math.random() * 5; i++) {
let x = 400 + Math.random() * 1000
//this.make(ArrowUpFire, Vec2.make(-x, x * 3), {})
}
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/showcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class SuitRankDecoration extends Play {
.map(() =>
(v_next = v_next
.sub(v_random()
.mul(Vec2.make(24, 30))
.add(Vec2.make(0, 40)))))
.mul(Vec2.make(24, 20))
.add(Vec2.make(0, 30)))))
.map(v => {
v.x += 120
let _ = this.make(Anim, v, { name: 'suit'})
Expand All @@ -88,7 +88,7 @@ export class SuitRankDecoration extends Play {
})
this.decsuit.push(...more_suits)

this.rank = this.make(Anim, Vec2.make(140, 32), { name: 'rank' })
this.rank = this.make(Anim, Vec2.make(140, 32), { name: 'rank_2' })
this.rank.origin = Vec2.make(32, 32)
this.rank.play_now('a')
this.rank.scale = Vec2.make(0.6, 0.6)
Expand Down

0 comments on commit fd75ea7

Please sign in to comment.