Create - Applications From Ideas Written Response Submission Template
Create - Applications From Ideas Written Response Submission Template
2a)
The maze game was created using code studio. My game is a maze game and its
purpose is for the black square to collect all the red dots to win. The player will
use the arrow keys to move the black square throughout the game. If the black
square collides into a wall, the game is over. The video illustrates the black
square moving through the maze. It captures the red squares and it collides into
a wall, ending the game.
2b)
function movement() {
onEvent("start", "click", function() {
setScreen("screen1");
hideElement("start");
timedLoop(17, function() {
xVel = 0;
yVel = 0;
if (keys[0]) {
xVel += -2;
}
if (keys[1]) {
xVel += 2;
}
if (keys[2]) {
yVel += -2;
}
if (keys[3]) {
yVel += 2;
}
setPosition("squareboi", getXPosition("squareboi")+xVel,
getYPosition("squareboi")+yVel);
});
});
onEvent("screen1", "keydown", function(event) {