Skip to content

Commit

Permalink
Update hoc22.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
neonerz committed Oct 5, 2022
1 parent cca6f80 commit 4aca362
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions hoc22.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ enum TwoDirection {
Right
}

enum FourDirectionUpDown {
//% block="up"
Up,
//% block="down"
Down,
//% block="left"
Left,
//% block="right"
Right
}

enum RedLaserSlide {
//% blockIdentity="blocks.custom" enumval=971 block="Red Shift Right"
//% jres alias=RED_SHIFT_RIGHT
Expand Down Expand Up @@ -195,8 +206,22 @@ namespace hoc22 {
* Clay Ball Move
*/
//% block="clay ball move %d by %n"
export function clayBallMove(d: SixDirection, n: number): void {
agent.move(d, n)
export function clayBallMove(d: FourDirectionUpDown, n: number): void {
switch (d) {
case FourDirectionUpDown.Up:
agent.move(SixDirection.Up, n)
break;
case FourDirectionUpDown.Down:
agent.move(SixDirection.Down, n)
break;
case FourDirectionUpDown.Left:
agent.move(SixDirection.Left, n)
break;
case FourDirectionUpDown.Down:
agent.move(SixDirection.Down, n)
break;
}

}

/**
Expand Down

0 comments on commit 4aca362

Please sign in to comment.