2.1 Flashcards
Abstraction
The process of separating ideas from reality, hiding unnecessary detail and showing the detail that’s important in context.
Adv and dis of abstraction
Simplifies things that may be very complex.
Simplifies the problem (can process faster).
Less memory requirements.
how is abstraction used
emove unnecessary elements [1]
Reduce computational resources required [1]
Focus on the main purpose of program//does not
detract from main purpose of program [1]
e.g. appearance of characters is replaced by object
// a character is a stick man [1]
Places on the board are replaced with shapes and
place name//e.g. a square that says ‘town’ rather
than an actual town with buildings[1]
Scenery is removed // e.g. trees, rivers are not
included [1]
how is abstraction used examples
the details of people/students have been removed and just replaced with symbols (their names)
classorm dispalys like books have been removed
diagram is not to scale
inputs
room size
rooms shape
outputs
3D image of room
error emsages
subprograms
small subprogram are easier to read making it more efficient, it avoids repeated code and they can be reused in other programs saving time, the subprogram can be tested individually before adding them to the main program
preconditions
Program is split into small components
Can identify components that are needed in more than
one place
Write these are independent modules
They can be imported into other areas of the game
They can be imported into future games that are made
They can be edited and tested independently, then the
changes auto-update throughout the program(s)
Sub-procedure character Movement can be used throughout different levels – saves having to rewrite the
code for moving the character
Can import sub-procedures e.g. graphics, to save writing
these. More likely to be error free as tested
Will save time (not having to rewrite/test code)
Can update one module and it will change all programs
that use it – don’t have to change every place the code is
written, avoids accidentally missing one
Can test independently
Can use code other people have written, to save time
writing and testing
ways to input
Camera/eye tracker…
…Move/blink to send signal
Microphone…
…Make sound to send signal
Puff/suck switch…
..blow/suck to send signal.
Microphone…
…To allow the device to hear spoken
requests.
Buttons…
…To turn the device off or on / To mute
device/ to put device in privacy mode
ways to output
Speaker…
…To play the device’s responses
LEDs…
…To indicate the device is on/listening
Screen…
…To show visual informatio
. using a top-down module design it helps me to identify what I need before I start coding as I am able to break
the problem down into smaller parts allowing me to look at each part of the problem more specifically. This will
allow me to use the computational thinking skill “thinking ahead” to determine the inputs and outputs; this also
allows me to use the computational thinking skill “thinking logically” to look at the where decisions are required
and what effects it will have on other parts of the solution. This will give my working solution some structure
letting me work towards my solution systematically/ efficiently
I am using the top down module design because it allows me to make use of decomposition, breaking down the problem into smaller subproblems which makes it easier me to see what I need and how I will do each area. This will also allow me to use computational thinking such as thinking concurrently as I can figure out which parts can be done at the same time and what needs to be done first so that the next step can be done (e.g. the character moving and the walking sound effect can be done at the same time) .
Intro screen
the first thing that would load up.and consits of the game title, this is separate because it loads up all the vanicibles/graphics, sounds so that the first screen can be shown, this occurs before loading the game/ playing it. when the space key is pressed it will take them to the main menu.
menu
play game option
would take you to the play game section, loading the main game from the first level.
Scoreboard option
this loads up the scoreboard allowing the user to see it before playing the game which my stakeholder wanted it they wanted to see what score they had to beat.
Quit option
Playing
Initialize game
At the start of every new game variables such as the life/bullet variable are reset to their starting values, the score variable is rest to zero, etc.
Visuals (in pixel art style)
Walking animation
When the user picks the point they want to go to, two characters sprites will be played in loop to give the illusion that they’re walking to the point.
Jumping animation
If the user reaches the end destination in time, the character sprite will be displayed to be jumping until the pop up of ‘you got to school in time) shows up.
Sound
Clicking
Gun shot
When the user left mouse clicks within the screen a short gunshot sound will be played if the bullet if the
user still has bullets left to “fire”.
Vampire bat
Flying sound
A flapping sound is played whenever a target is spawned on to the screen and moving around.
Scoreboard
new high score name and validation
This checks if the users final score is greater that then score boards lowest score, if yes then it checks whether a suitable name is given in. if a suitable name is given then it is used for the score board.
New high score
This places the users final score on the score board in the suitable place to correspond with the other final scores.
Display score board
This displays the score board for an amount of time then changes the game state for the score board state
to the menu state.
Pause button
Pause
To pause the game, the user would press the space key, stopping the game.
Un-pause
When the space key is pressed again the game will change from paused state to the playing state.