The title was created in photoshop by me and it's colour matches that of the gears to give the player a sense of familiarity.
The menu is split up into 3 separate actions. The first action declares the variables of the menu shown below
private action MenuVar ()
This sets the variables for the Menu
◳ Title2 := ◳ board → create picture(✿ Title3)
◳ Title2 → hide
◳ InstructionsTitle := ◳ board → create text(100, 20, 40, "Instructions")
◳ InstructionsTitle → hide
◳ Instructions := ◳ board → create text(50, 50, 20, "Something has gone very wrong with the professors latest invention \nand Widget is caught in the middle.\nHelp Widget to avoid the flying gears by tapping the screen. \nTapping left will move him left and tapping right will move him right. \nGood Luck\n\n(Tap Screen to Start)\n")
◳ Instructions → hide
end action
The second action Menu sets the position and visability of the menu
private action Menu ()
This sets the positions and visibility of the menu. This is called in Main
◳ Title2 → set pos(◳ board → width / 2, 50)
◳ Title2 → set width(500)
◳ Title2 → show
◳ InstructionsTitle → set pos(◳ board → width / 2 - 20, 100)
◳ InstructionsTitle → show
◳ Instructions → set pos(125, 170)
◳ Instructions → show
end action
and the third action MenuHide hides the menu so it is not visible during the game
private action MenuHide ()
This hides the menu during the game
◳ Title2 → hide
◳ InstructionsTitle → hide
◳ Instructions → hide
◳ board → update on wall
end action
It was necessary to split the menu into three as they each need to be called at a separate time. All three are called in Main as shown below.
action main ()
◳ board := ♻ game → start
This game only has one life. This code turns off the life visibility as they are not required.
♻ game → set life visible(false)
This ensures that the characters don't fall off the top or bottom of the screen through the use of obstacles.
◳ board → create obstacle(0, 0, ◳ board → width, 0, 1)
◳ board → create obstacle(0, ◳ board → height, ◳ board → width, 0, 1)
▷ Backgrounds
▷ MenuVar
The stop variable is used to determine whether the sprite is to stop running. 1 = Run 0 = Stop
◳ Stop := 1
✿ Crash → play
This ensures that the game doesn't start until the board has been touched
while not ◳ board → touched do
▷ Menu
◳ board → update on wall
end while
▷ MGame
▷ MenuHide
This is where the rate of score increases it adds the value of scoreadd once every second
time → run every(1, perform)
where perform() is
♻ game → score := ♻ game → score + ◳ scoreadd
end
end action
The Mgame function as shown in main is a combination of all other elments of the game that was required in main. By placing these in a function it helped to condense the main and thus help the code to run more efficiently
Mgame looks as shown below
private action MGame ()
This is where the game information that runs in main is kept
◳ Gears := ◳ board → create sprite set
The 3 is the amount of gears that will spawn at any given time
▷ SpawnGears(3)
This sets the sprite sheet and it's grid
◳ SpriteSheet := ◳ board → create sprite sheet(✿ CharSheet6)
◳ SpriteSheet → set frame grid(3, 4, 0, 0, 0, 0, 0)
▷ Animations
This sets the score increase to 1
◳ scoreadd := 1
This sets the direction of the background (0 and 3 = No scrolling, 1 =Scroll Left, 2= Scroll Right
◳ Direction := 3
This sets the default score as well as set the position of the score display.
♻ game → set score(0)
◳ ScoreDisplay := ◳ board → create text(100, 20, 40, "Score: " ∥ ♻ game → score)
◳ ScoreDisplay → set pos(◳ board → width / 2, 0)
end action
The score is also visable in the Main and works to add a score once every second. The position of the score is declared in MGame. By default the score is set to 1 however when the Gear and the character collide this is set to 0 and therefore the score stops updating itself then.

Great title screen and a backstory to the users of this software. The backstory shows that you understand the client and the eventual users of this game.
ReplyDelete