Today's Agenda
3:30 - 3:45 PM - Greetings & Icebreaker!
3:45 - 4:00 PM - Game Design!
4:00 - 4:15 PM - Activities!
4:10 - 5:15 PM - Let’s make a game!
5:15 - 5:30 PM - Exporting & Sharing
Step 1: Open up MakeCode Arcade. (https://arcade.makecode.com/#)
Step 2: Click "New Project" and Give your project name "Chase the Apple"
Step 3: Change it to JavaScript by clicking "JavaScript"
Step 4: Code: set background color
Step 5: Add code to create a sprite a set it to a variable name mySprite.
Step 6: Draw or select Player character by using the image editor.
Step 7: Put in the code move mySprite with the controller.
Step 8: Create a sprite again and set it to the a variable named pizza.
Step 9: Create a sprite again and set it to the a variable named pizza.
Step 10: Use the image editor for Pizza.
Step 10: Survey!
Step 11: Export & Share!
Codes
scene.setBackgroundColor(0)
let mySprite: Sprite = null
scene.setBackgroundColor(7)
mySprite = sprites.create(img``, SpriteKind.Player)
Choose your Player sprite
sprites.onOverlap(SpriteKind.Player,SpriteKind.Food, function (sprite, otherSprite) {
})
sprites.onOverlap(SpriteKind.Player,SpriteKind.Food, function (sprite, otherSprite) {
info.changeScoreBy(1)
})
sprites.onOverlap(SpriteKind.Player,SpriteKind.Food, function (sprite, otherSprite) {
info.changeScoreBy(1)
otherSprite.setPosition(0,0)
})
sprites.onOverlap(SpriteKind.Player,SpriteKind.Food, function (sprite, otherSprite) {
info.changeScoreBy(1)
otherSprite.setPosition(randint(0,160), randint(0,120))
})
sprites.onOverlap(SpriteKind.Player,SpriteKind.Food, function (sprite, otherSprite) {
info.changeScoreBy(1)
otherSprite.setPosition(randint(0,160), randint(0,120))
info.startCountdown(10)
})
Congratulations, you have completed your game! Use the Game Simulator to play by moving you Player around the screen to try and eat as much pizza as possible before the time runs out.
To share your work!
Press this button on the upper right corner to share
Click "Publish project"
Click "Copy" and share your address link and copy and paste that into the Zoom Chat