Skip to content

Commit

Permalink
stone falling
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeChamp-SS committed Jan 30, 2021
1 parent 111f3d7 commit 70a96a9
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 28 deletions.
Binary file modified .github/makecode/blocks.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 modified .github/makecode/blocksdiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions images.g.jres

Large diffs are not rendered by default.

179 changes: 160 additions & 19 deletions images.g.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions main.blocks

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def on_right_pressed():
"""))
controller.right.on_event(ControllerButtonEvent.PRESSED, on_right_pressed)

stone: Sprite = None
projectile: Sprite = None
cnt = 0
hacker: Sprite = None
Expand Down Expand Up @@ -175,3 +176,11 @@ def on_update_interval():
"""), -19, 0)
projectile.y = 50
game.on_update_interval(5000, on_update_interval)

def on_update_interval2():
global stone
stone = sprites.create_projectile_from_side(assets.image("""
image14
"""), 0, 55)
stone.x = hacker.x
game.on_update_interval(5000, on_update_interval2)
8 changes: 8 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ controller.up.onEvent(ControllerButtonEvent.Pressed, function () {
cnt += 2
}
})
scene.onOverlapTile(SpriteKind.Projectile, sprites.castle.tilePath2, function (sprite, location) {
stone.destroy(effects.disintegrate, 500)
})
controller.left.onEvent(ControllerButtonEvent.Pressed, function () {
hacker.setImage(assets.image`Temporary asset3`)
})
controller.right.onEvent(ControllerButtonEvent.Pressed, function () {
hacker.setImage(assets.image`Temporary asset2`)
})
let projectile: Sprite = null
let stone: Sprite = null
let cnt = 0
let hacker: Sprite = null
scene.setBackgroundImage(img`
Expand Down Expand Up @@ -159,3 +163,7 @@ game.onUpdateInterval(5000, function () {
projectile = sprites.createProjectileFromSide(assets.image`smartCloud`, -19, 0)
projectile.y = 50
})
game.onUpdateInterval(5000, function () {
stone = sprites.createProjectileFromSide(assets.image`stone_img`, 0, 81)
stone.x = hacker.x
})

1 comment on commit 70a96a9

@CodeChamp-SS
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.