diff --git a/teams/Roach/Gacha.png b/teams/Roach/Gacha.png deleted file mode 100644 index fcb7288..0000000 Binary files a/teams/Roach/Gacha.png and /dev/null differ diff --git a/teams/Roach/resource/anime.mbt b/teams/Roach/resource/anime.mbt new file mode 100644 index 0000000..53e77be --- /dev/null +++ b/teams/Roach/resource/anime.mbt @@ -0,0 +1,53 @@ +pub fn animeBlock(self : Game) -> Unit { + if game.counter > 10 && game.counter < 29 && game.counter % 6 == 0 { + for i in [0,1,2]{ + self.block[i].changeColor_random() + } + } + if game.counter > 28 && game.counter < 41 && game.counter % 4 == 0 { + for i in [0,1,2]{ + self.block[i].changeColor_random() + } + } + if game.counter > 41 && game.counter < 51 && game.counter % 2 == 0 { + for i in [0,1,2]{ + self.block[i].changeColor_random() + } + } +} +pub fn animeBall(self : Game) -> Unit { + if game.counter > 50 && game.counter < 66 { + self.ball.x += 7 + } +} + +pub fn animeProgressBar(self : Game) -> Unit { + if self.pbar.width < 120 && self.coin > 0 { + if self.time % 5 == 0 { + self.pbar.width += 2 + } + } else { + self.pbar.width = 0 + } +} + +pub fn animeSprite(self : Game) -> Unit { + @wasm4.trace("anicounter\{self.counter} \{self.block[1].sprite_block.x}") + if self.counter >= 0 { + if true { + self.block[0].sprite_block.x = 20 + self.block[0].sprite_block.y = 30 + self.block[1].sprite_block.x = 20 + self.block[1].sprite_block.y = 30 + self.block[2].sprite_block.x = 20 + self.block[2].sprite_block.y = 30 + } + } else { + self.block[0].sprite_block.x = self.block[0].x + self.block[0].sprite_block.y = self.block[0].y + self.block[1].sprite_block.x = self.block[1].x + self.block[1].sprite_block.y = self.block[1].y + self.block[2].sprite_block.x = self.block[2].x + self.block[2].sprite_block.y = self.block[2].y + } +} diff --git a/teams/Roach/resource/draw.mbt b/teams/Roach/resource/draw.mbt new file mode 100644 index 0000000..f6e5497 --- /dev/null +++ b/teams/Roach/resource/draw.mbt @@ -0,0 +1,136 @@ +struct Color { + mut palette : UInt +} + +pub fn Color::new() -> Color { + { palette: 2 } +} + +let randomer : @random.Rand = @random.Rand::new() + +fn draw(self : Game) -> Unit { + //drawBkg(self) + drawBlock(self) + drawBall(self) + drawCoin(self) + drawUI() + drawProgressBar(self) +} + +//fn drawBkg(self : Game) -> Unit { +// @wasm4.set_draw_colors(index=1, 2) +// @wasm4.set_draw_colors(index=2, 1) +// @wasm4.set_draw_colors(index=3, 4) +// @wasm4.set_draw_colors(index=4, 3) +// @wasm4.blit( +// hex, +// 0, +// 0, +// 160, +// 160, +// { one_bit_per_pixel: true, flip_x: false, flip_y: false, rotate: false }, +// ) +//} + +fn drawBlock(self : Game) -> Unit { + for i in [0, 1, 2] { + self.block[i].x = 20 + 45 * i + } + for i in [0, 1, 2] { + @wasm4.set_draw_colors(self.block[i].color.palette) + @wasm4.rect( + self.block[i].x, + self.block[i].y, + self.block[i].width, + self.block[i].height, + ) + if game.counterFlag == false { + drawSprite(self, i) + } + } +} + +fn drawSprite(self : Game, blockindex : Int) -> Unit { + @wasm4.set_draw_colors(1) + match self.block[blockindex].event_block { + "None" => return + "Sun" => { + self.block[blockindex].sprite_block = { + x: self.block[blockindex].x + 3, + y: 43, + sprite: sun_sprite, + } + @wasm4.blit( + self.block[blockindex].sprite_block.sprite, + self.block[blockindex].sprite_block.x, + self.block[blockindex].sprite_block.y, + SunWidth, + SunHeight, + { one_bit_per_pixel: true, flip_x: false, flip_y: false, rotate: false }, + ) + } + "Moon" => { + self.block[blockindex].sprite_block = { + x: self.block[blockindex].x + 3, + y: 43, + sprite: moon_sprite, + } + @wasm4.blit( + self.block[blockindex].sprite_block.sprite, + self.block[blockindex].sprite_block.x, + self.block[blockindex].sprite_block.y, + MoonWidth, + MoonHeight, + { one_bit_per_pixel: true, flip_x: false, flip_y: false, rotate: false }, + ) + } + _ => return + } +} + +fn drawBall(self : Game) -> Unit { + if game.gameOverFlag == false { + @wasm4.set_draw_colors(3) + @wasm4.rect(31, 108, 100, 5) + @wasm4.set_draw_colors(2) + @wasm4.oval(self.ball.x, self.ball.y, self.ball.width, self.ball.height) + } +} + +fn drawProgressBar(self : Game) -> Unit { + @wasm4.set_draw_colors(2) + @wasm4.rect(self.pbar.x, self.pbar.y, self.pbar.width, self.pbar.height) +} + +fn drawCoin(self : Game) -> Unit { + @wasm4.set_draw_colors(2) + @wasm4.text(":\{self.coin}", 74, 150) + coin_sprite.blit( + 64, + 150, + 8, + 8, + { one_bit_per_pixel: false, flip_x: false, flip_y: false, rotate: false }, + ) +} + +fn drawUI() -> Unit { + @wasm4.text("G a c h a", 44, 6) + @wasm4.text( + "Generator:\{(event.sunAmount-event.moonAmount).reinterpret_as_int()}", + 32, + 127, + ) +} + +pub fn changeColor(self : Block) -> Unit { + if self.color.palette < 4 { + self.color.palette += 1 + } else { + self.color.palette = 1 + } +} + +pub fn changeColor_random(self : Block) -> Unit { + self.color.palette = randomer.uint(limit=3) + 2 +} diff --git a/teams/Roach/resource/event.mbt b/teams/Roach/resource/event.mbt new file mode 100644 index 0000000..c11bf00 --- /dev/null +++ b/teams/Roach/resource/event.mbt @@ -0,0 +1,79 @@ +let commonEventChance : UInt = 30 + +let rareEventChance : UInt = 10 + +let superRareEventChance : UInt = 1 + +pub let commonEvent = ["Sun", "Moon"] + +pub let rareEvent = ["Hurricane"] + +pub let superRareEvent = ["Win"] + +let commonEventAmount : UInt = commonEvent.length().reinterpret_as_uint() + +let rareEventAmount : UInt = rareEvent.length().reinterpret_as_uint() + +let superRareEventAmount : UInt = superRareEvent.length().reinterpret_as_uint() + +pub struct Event { + mut sunAmount : UInt + mut moonAmount : UInt +} + +let event : Event = { sunAmount: 0, moonAmount: 0 } + +pub fn runEvents() -> Unit { + + if game.time % 300 == 0 { + game.coin += event.sunAmount.reinterpret_as_int() + game.coin -= event.moonAmount.reinterpret_as_int() + } +} +fn getEvent() -> String { + let rand = (game.time + randomer.uint()) % 100 + if rand < commonEventChance { + getCommonEvent() + } else if rand < commonEventChance + rareEventChance { + getRareEvent() + } else if rand < commonEventChance + rareEventChance + superRareEventChance { + getSuperRareEvent() + } else { + "None" + } +} +fn getCommonEvent() -> String { + let rand = ((game.time + randomer.uint()) % commonEventAmount).reinterpret_as_int() + commonEvent[rand] +} + +fn getRareEvent() -> String { + let rand = ((game.time + randomer.uint()) % rareEventAmount).reinterpret_as_int() + rareEvent[rand] +} + +fn getSuperRareEvent() -> String { + let rand = ((game.time + randomer.uint()) % superRareEventAmount).reinterpret_as_int() + superRareEvent[rand] +} + +pub fn identifyEvent(eventName : String) -> String { + match eventName { + "None" => @wasm4.trace("None") + "Sun" => runSunEvent() + "Moon" => runMoonEvent() + _ => @wasm4.trace("Unknown event") + } + eventName +} + + +fn runSunEvent() -> Unit { + event.sunAmount += 1 + @wasm4.trace("Sun") +} + +fn runMoonEvent() -> Unit { + event.moonAmount += 1 + @wasm4.trace("Moon") +} diff --git a/teams/Roach/resource/game.mbt b/teams/Roach/resource/game.mbt new file mode 100644 index 0000000..61fc674 --- /dev/null +++ b/teams/Roach/resource/game.mbt @@ -0,0 +1,108 @@ +pub struct Block { + mut width : Int + mut height : Int + mut x : Int + mut y : Int + mut color : Color + mut event_block : String + mut sprite_block : MoveSprite +} + +pub fn Block::new() -> Block { + { width: 30, + height: 70, + x: 0, + y: 20, + color: Color::new(), + event_block : "None", + sprite_block : MoveSprite::new() + } +} + +pub struct Ball { + mut width : Int + mut height : Int + mut x : Int + mut y : Int + mut color : Color +} + +pub fn Ball::new() -> Ball { + { width: 25, height: 25, x: 19, y: 98, color: Color::new() } +} + +pub struct Game { + mut block : Array[Block] + mut ball : Ball + mut frame_count : Int + mut prev_gamepad : @wasm4.GamePad + mut coin : Int + mut time : UInt + mut delay : UInt + mut counter : UInt + mut counterFlag : Bool + mut pbar :Block + mut gameOverFlag:Bool +} + +pub fn Game::new() -> Game { + { + block: [Block::new(), Block::new(), Block::new()], + ball: Ball::new(), + frame_count: 0, + prev_gamepad: @wasm4.GamePad::default(), + coin: 0, + time: 0, + delay: 0, + counter: 65, + counterFlag: false, + pbar: Block::{width: 0, height: 10, x: 20, y: 138, color: Color::new(), event_block : "None", sprite_block : MoveSprite::new()} , + gameOverFlag: false + } +} + +pub fn input(self : Game) -> Unit { + let gamepad = @wasm4.get_gamepad() + if game.counterFlag { + game.counter -= 1 + animeBlock(self) + animeBall(self) + animeSprite(self) + } + if game.counter == 0 { + for i in [0, 1, 2] { + self.block[i].changeColor_random() + self.block[i].event_block = identifyEvent(getEvent()) + + @wasm4.trace("\{self.time}") + + } + + game.counter = 65 + game.counterFlag = false + game.ball.x = 19 + if game.block[0].color.palette == game.block[1].color.palette { + if game.block[1].color.palette == game.block[2].color.palette { + music() + } + } else { + nothing() + prize() + } + } + if gamepad != self.prev_gamepad { + if gamepad.button_1 && game.coin > 0 && game.counterFlag == false { + game.coin -= 1 + game.counterFlag = true + } + } + self.prev_gamepad = gamepad +} + +fn gameOver() -> Unit { + @wasm4.text("GAME OVER", 44, 105) + @wasm4.text("press R to restart", 8, 115) + game.time += 1 + game.coin = 0 + game.gameOverFlag = true +} diff --git a/teams/Roach/resource/lib/hello.mbt b/teams/Roach/resource/lib/hello.mbt new file mode 100644 index 0000000..9012592 --- /dev/null +++ b/teams/Roach/resource/lib/hello.mbt @@ -0,0 +1,3 @@ +pub fn hello() -> String { + "Hello, world!" +} diff --git a/teams/Roach/resource/lib/hello_test.mbt b/teams/Roach/resource/lib/hello_test.mbt new file mode 100644 index 0000000..e0e3a7d --- /dev/null +++ b/teams/Roach/resource/lib/hello_test.mbt @@ -0,0 +1,5 @@ +test "hello" { + if @lib.hello() != "Hello, world!" { + fail!("@lib.hello() != \"Hello, world!\"") + } +} diff --git a/teams/Roach/resource/lib/moon.pkg.json b/teams/Roach/resource/lib/moon.pkg.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/teams/Roach/resource/lib/moon.pkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/teams/Roach/resource/moon.pkg.json b/teams/Roach/resource/moon.pkg.json new file mode 100644 index 0000000..53782cd --- /dev/null +++ b/teams/Roach/resource/moon.pkg.json @@ -0,0 +1,18 @@ +{ + "import": [ + "moonbitlang/wasm4" + ], + "link": { + "wasm": { + "exports": [ + "start", + "update" + ], + "import-memory": { + "module": "env", + "name": "memory" + }, + "heap-start-address": 6560 + } + } +} diff --git a/teams/Roach/resource/sprite.mbt b/teams/Roach/resource/sprite.mbt new file mode 100644 index 0000000..1e148b1 --- /dev/null +++ b/teams/Roach/resource/sprite.mbt @@ -0,0 +1,41 @@ +let new_sprite : @wasm4.Sprite = @wasm4.sprite(b"") + +let coin_sprite : @wasm4.Sprite = @wasm4.sprite( + b"\xaa\xaa\xa0\x0a\x80\x56\x81\x16\x84\x46\x85\x16\xa5\x5a\xaa\xaa", +) + + +// hex +const HexWidth = 160; +const HexFlags = 0; // BLIT_1BPP +let hex: @wasm4.Sprite = @wasm4.sprite(b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x7f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfe\x3f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfe\x3f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfc\x1f\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xf8\x1f\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xf8\x1f\xff\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\xf8\x0f\xff\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xf0\x07\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xf0\x07\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xe0\x03\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xc0\x01\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xc0\x01\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x1f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x00\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x00\x00\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe0\x00\x00\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x00\x00\x00\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x00\x00\x00\x1f\xff\xe0\x00\x3f\xff\x00\x00\x00\x00\x7f\xfe\x00\x03\xff\xfc\x00\x00\x00\x00\x1f\xff\xe0\x00\x7f\xff\x00\x00\x00\x00\x7f\xff\x00\x03\xff\xfc\x00\x00\x00\x00\x0f\xff\xf0\x00\xff\xfe\x00\x00\x00\x00\x7f\xff\x80\x07\xff\xf8\x00\x00\x00\x00\x0f\xff\xf0\x00\xff\xfe\x00\x00\x00\x00\x7f\xff\x80\x07\xff\xf8\x00\x00\x00\x00\x07\xff\xf8\x01\xff\xfe\x00\x00\x00\x00\x3f\xff\xc0\x0f\xff\xf0\x00\x00\x00\x00\x03\xff\xf8\x01\xff\xfc\x00\x00\x00\x00\x1f\xff\xc0\x0f\xff\xe0\x00\x00\x00\x00\x01\xff\xfc\x07\xff\xf8\x00\x00\x00\x00\x0f\xff\xf0\x1f\xff\xc0\x00\x00\x00\x00\x01\xff\xfc\x07\xff\xf8\x00\x00\x00\x00\x0f\xff\xf0\x1f\xff\xc0\x00\x00\x00\x00\x00\xff\xfe\x0f\xff\xf0\x00\x00\x00\x00\x07\xff\xf0\x3f\xff\x80\x00\x00\x00\x00\x00\xff\xfe\x0f\xff\xf0\x00\x00\x00\x00\x07\xff\xf0\x3f\xff\x00\x00\x00\x00\x00\x00\xff\xff\x0f\xff\xe0\x00\x00\x00\x00\x03\xff\xf8\x7f\xff\x00\x00\x00\x00\x00\x00\x7f\xff\x8f\xff\xc0\x00\x00\x00\x00\x01\xff\xf8\xff\xff\x00\x00\x00\x00\x00\x00\x7f\xff\x9f\xff\xc0\x00\x00\x00\x00\x01\xff\xfc\xff\xff\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xff\x80\x00\x00\x00\x00\x01\xff\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xff\x80\x00\x00\x00\x00\x00\xff\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xff\x80\x00\x00\x00\x00\x00\xff\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xff\x00\x00\x00\x00\x00\x00\x7f\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x07\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x03\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x03\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x01\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x01\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xc0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xc0\x00\x00\x00\x00\x00\x00\x01\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xc0\x00\x00\x00\x00\x00\x00\x03\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xc0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00\x00\x01\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x01\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x03\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x03\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x07\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xff\x00\x00\x00\x00\x00\x00\x7f\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xff\x80\x00\x00\x00\x00\x00\xff\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xff\x80\x00\x00\x00\x00\x00\xff\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xff\x80\x00\x00\x00\x00\x01\xff\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x7f\xff\x9f\xff\xc0\x00\x00\x00\x00\x01\xff\xfc\xff\xff\x00\x00\x00\x00\x00\x00\x7f\xff\x8f\xff\xc0\x00\x00\x00\x00\x01\xff\xf8\xff\xff\x00\x00\x00\x00\x00\x00\xff\xff\x0f\xff\xe0\x00\x00\x00\x00\x03\xff\xf8\x7f\xff\x00\x00\x00\x00\x00\x00\xff\xfe\x0f\xff\xf0\x00\x00\x00\x00\x07\xff\xf0\x3f\xff\x00\x00\x00\x00\x00\x00\xff\xfe\x0f\xff\xf0\x00\x00\x00\x00\x07\xff\xf0\x3f\xff\x80\x00\x00\x00\x00\x01\xff\xfc\x07\xff\xf8\x00\x00\x00\x00\x0f\xff\xf0\x1f\xff\xc0\x00\x00\x00\x00\x03\xff\xf8\x03\xff\xfc\x00\x00\x00\x00\x1f\xff\xe0\x1f\xff\xe0\x00\x00\x00\x00\x03\xff\xf8\x01\xff\xfc\x00\x00\x00\x00\x1f\xff\xc0\x0f\xff\xe0\x00\x00\x00\x00\x07\xff\xf8\x01\xff\xfe\x00\x00\x00\x00\x3f\xff\xc0\x0f\xff\xf0\x00\x00\x00\x00\x0f\xff\xf0\x00\xff\xfe\x00\x00\x00\x00\x7f\xff\x80\x07\xff\xf8\x00\x00\x00\x00\x0f\xff\xf0\x00\xff\xfe\x00\x00\x00\x00\x7f\xff\x80\x07\xff\xf8\x00\x00\x00\x00\x1f\xff\xe0\x00\x7f\xff\x00\x00\x00\x00\x7f\xff\x00\x03\xff\xfc\x00\x00\x00\x00\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x00\x00\x00\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x00\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\x00\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe0\x00\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x00\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x80\x00\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x80\x00\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xc0\x01\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xc0\x01\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xe0\x03\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xf0\x07\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xf0\x07\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\xf8\x0f\xff\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xf8\x1f\xff\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xf8\x1f\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfc\x1f\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfe\x3f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xfe\x3f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x7f\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xff\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\xff\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00") + +//Sun +const SunWidth = 24 + +const SunHeight = 24 + + + +const Sun = b"\xff\xff\xff\xff\xff\xff\xff\xe7\xff\xef\xe7\xf7\xf3\xff\xcf\xf3\xff\xcf\xff\xc3\xff\xff\x00\xff\xfe\x00\x7f\xfe\x00\x7f\xfc\x00\x3f\xcc\x00\x33\xcc\x00\x33\xfc\x00\x3f\xfe\x00\x7f\xfe\x00\x7f\xff\x00\xff\xff\xc3\xff\xf3\xff\xcf\xf3\xff\xcf\xef\xe7\xf7\xff\xff\xff\xff\xff" + +let sun_sprite : @wasm4.Sprite = @wasm4.sprite(Sun) + +//Moon +const MoonWidth = 24 + +const MoonHeight = 24 + +const Moon = b"\xff\xff\xff\xff\x00\xff\xfc\x00\x3f\xf8\x00\x1f\xf0\x03\xcf\xe0\x0f\xff\xc0\x1f\xff\xc0\x3f\xff\x80\x7f\xff\x80\x7f\xff\x80\xff\xff\x80\xff\xff\x80\xff\xff\x80\xff\xff\x80\xff\xff\x80\xff\xff\xc0\x7f\xff\xc0\x7f\xff\xe0\x3f\xff\xf0\x1f\xff\xf8\x0f\xff\xfc\x03\x7f\xff\x00\xff\xff\xff\xff" + +let moon_sprite : @wasm4.Sprite = @wasm4.sprite(Moon) + +struct MoveSprite { + mut x : Int + mut y : Int + sprite : @wasm4.Sprite +} + +pub fn MoveSprite::new() -> MoveSprite { + { x: 0, y: 0, sprite: new_sprite } +} diff --git a/teams/Roach/resource/top.mbt b/teams/Roach/resource/top.mbt new file mode 100644 index 0000000..5b3e844 --- /dev/null +++ b/teams/Roach/resource/top.mbt @@ -0,0 +1,22 @@ +pub fn start() -> Unit { + game.coin += 10 +} + +let game : Game = Game::new() + +pub fn update() -> Unit { + if game.gameOverFlag == false { + game.time += 1 + } + + runEvents() + animeProgressBar(game) + + if game.coin<=0 { + gameOver() + } + + draw(game) + + game.input() +} diff --git a/teams/Roach/resource/version.md b/teams/Roach/resource/version.md new file mode 100644 index 0000000..47b5b42 --- /dev/null +++ b/teams/Roach/resource/version.md @@ -0,0 +1 @@ +moon 0.1.20241106 (79e45ae 2024-11-06) ~/.moon/bin/moon moonc v0.1.20241106+8f17a3fc7 ~/.moon/bin/moonc moonrun 0.1.20241106 (79e45ae 2024-11-06) ~/.moon/bin/moonrun \ No newline at end of file diff --git a/teams/Roach/resource/voice.mbt b/teams/Roach/resource/voice.mbt new file mode 100644 index 0000000..fab1042 --- /dev/null +++ b/teams/Roach/resource/voice.mbt @@ -0,0 +1,24 @@ +pub fn prize() -> Unit { + @wasm4.tone_note_mode( + (@wasm4.Note::new(50, bend=0), None), + @wasm4.ADSR::new(60), + @wasm4.ADSRVolume::new(100), + @wasm4.ToneFlag::new(), + ) + @wasm4.trace("prize") +} + +pub fn nothing() -> Unit { + @wasm4.trace("nothing") +} + +pub fn music()-> Unit{ + game.coin +=10 + @wasm4.tone_note_mode( + (@wasm4.Note::new(69, bend=10), None), + @wasm4.ADSR::new(60), + @wasm4.ADSRVolume::new(100), + @wasm4.ToneFlag::new(), + ) +} +let x : @wasm4.ToneFlag =@wasm4.ToneFlag::new() \ No newline at end of file diff --git a/teams/Roach/resource/w4png/Moon.aseprite b/teams/Roach/resource/w4png/Moon.aseprite new file mode 100644 index 0000000..79f37da Binary files /dev/null and b/teams/Roach/resource/w4png/Moon.aseprite differ diff --git a/teams/Roach/resource/w4png/Moon.png b/teams/Roach/resource/w4png/Moon.png new file mode 100644 index 0000000..b7ed2b6 Binary files /dev/null and b/teams/Roach/resource/w4png/Moon.png differ diff --git a/teams/Roach/resource/w4png/OIP-C.jpg b/teams/Roach/resource/w4png/OIP-C.jpg new file mode 100644 index 0000000..8ec726d Binary files /dev/null and b/teams/Roach/resource/w4png/OIP-C.jpg differ diff --git a/teams/Roach/resource/w4png/Sun.aseprite b/teams/Roach/resource/w4png/Sun.aseprite new file mode 100644 index 0000000..7573f59 Binary files /dev/null and b/teams/Roach/resource/w4png/Sun.aseprite differ diff --git a/teams/Roach/resource/w4png/Sun.png b/teams/Roach/resource/w4png/Sun.png new file mode 100644 index 0000000..0c517b6 Binary files /dev/null and b/teams/Roach/resource/w4png/Sun.png differ diff --git a/teams/Roach/resource/w4png/hex.png b/teams/Roach/resource/w4png/hex.png new file mode 100644 index 0000000..9593e5b Binary files /dev/null and b/teams/Roach/resource/w4png/hex.png differ diff --git a/teams/Roach/resource/w4png/hexcircle.jpg b/teams/Roach/resource/w4png/hexcircle.jpg new file mode 100644 index 0000000..6e84117 Binary files /dev/null and b/teams/Roach/resource/w4png/hexcircle.jpg differ