User Tools

Site Tools


logolib:flyescape

Runs on Terrapin Logo 4 Runs on Terrapin Logo 3

Fly Escape

American Embassy School Grade 12 student Ricky developed the “Fly Escape” game in Terrapin Logo. Fly Escape turns the Logo turtle into a fly that needs to make its way through a maze of ever changing flypaper. Guide the fly using the keyboard and see how long you can avoid the trap.

Screen from Fly Escape For his project, Ricky describes the Fly Escape project and how he developed and tested it.

Game Description In Fly Escape, you have to keep the fly that is your character alive for as long as possible. It is a single player game, and the player controls the upward motion of the fly. The length of time your fly lives will be the score. When the game begins, it goes to full screen mode and displays a screen with “FLY ESCAPE” in big letters in the center, and below that, in smaller letters, the rules and controls, followed by “x to continue.” When the user presses 'x' the game should begin, causing the background to be silver with a black flypaper (which should be strips of random lengths) on the top and bottom of the screen scrolling to the left, where the fly, a black dot with flapping wings, starts. In the bottom right hand corner the score will appear. The fly should be moved up with the 'w' key, to the left with the 'a' and to the right with the 'd' key. When the fly touches the black fly-paper, the game is over. When the game ends, a screen will appear with a lose message. It will display the score, and ask if you want to play again. If the player says 'y' then the game restarts. If the player says 'n', then the game clears. This game will require inputs at the beginning, or x, and the gameplay will use inputs of w, a, and d, and when it exits, 2 inputs will need to be present, y, and n. These inputs can be taken with the RC and IF commands.

Design of components of Fly Escape

Goal To navigate the fly for as long as possible through the fly paper lining the walls. The length of time the fly is alive is your score.

Interface A screen appears with FLY ESCAPE in big text in the center of the screen, and a quick version of the rules under it in smaller text, followed by “x to continue.” When x is pressed, the fly appears on the left side of the screen in the center, and the background will be silver, and the fly paper shall be black. The fly paper will be on the top and bottom of the screen, and will scroll across the screen, or somesuch.

Rules Don't let the fly touch the flypaper, or game over. The longer you stay alive, the higher your score.

Inputs

* x to continue. make "k = RC if (:k = x) then game.
* w, a, and d keys for directions given to the fly. read character commands will also work here.
* at the end, a y/n will be needed for playing again.

Exiting At the end, a screen will appear with a skull and crossbones or a giant X or something, signifying the end of the game. under whatever picture I have will be GAME OVER in big text, with “your score is: score” and “Play Again? y/n” in smaller text below it. when 'n' is pressed, cs ss.

Testing To test my game, I first had to ensure that all the screens were working properly. This meant that I had to run the program from every screen to test linkages. When I opened the game from the first method, FLYESCAPE, I was able to successfully navigate from the StartScreen to the GameScreen, to the EndScreen, back to the StartScreen which successfully restarted the GameScreen, and (by setting the score to 170 and then playing for 10 seconds) to the WinScreen, from where I was able to get back to the StartScreen. Throughout, I was noting whether all text was visible on my screen and whether it looked right. The next thing I had to test was the collision and the controls. I found that the Q-button would restart as it was meant to, and that the other keys would move the fly correctly, though when the fly was moved to the right or left, it tended to cause the game to slow down and some of the fly paper to disappear momentarily. Other than this small glitch, the controls all worked properly, and I found when I tested the collision that the fly died every way I could think of to make it die, including through cheating.

Lod the file into Logo. Alternately, open an editor, and paste the procedures into the editor. Then define the procedures with Edit/Define. Type FLYESCAPE to begin and see how long you can keep the fly buzzing!

flyescape.lgo
Procedure:
FLYESCAPE
Description:
See how long you can fly!
Level:
Beginner
Compatible:
Logo 3, Logo 4
Tags:
Fly, Escape, Maze
logolib/flyescape.txt · Last modified: 2018/08/27 03:39 (external edit)