Wednesday, 31 October 2012

Moving animation


 
This algorithm changes the characters costume every 0.3 seconds, creating the illusion of a flying bird. whilst also moving the character so it looks as if the bird is flying around the screen, not just hovering is one single location. this will continue on forever until thep plaer stops it.
 
This is a repeated algorithm as once the green flag is clicked the character will change until the player decides to stop it.
 
 


Tuesday, 30 October 2012

Say something


This is a short sequence, as soon as the green flag is clicked a speech bubble appears and the duck is made to look like it is communicating with the player.
this may become usefull increating a game as it can be used to provide the player instructions on how to play the game...

Glide

 
 
This algorithm instructs the charater to move a certain distance to a set destination (with x and y coordinates) , makeing it look like it is gliding.
 
This is a sequence as the algortium ends as soon as the character performs the set instructions once, the character will only move again if the sequence is started again (if the player presses the green flag again).
 


Follow the mouse


With this algorithm the character will follow the mouse around, it can be used  to control the main character.

Here when the green flag is clicked the character starts to follow the mouse around.
This is a repetition algorithm, as the character will follow the mouse forever until the gamer decids to stop. The algorthistum instructs the character to continuously point at the mouse point and move along with it.

dance twist


With this algorithm the image is slightly distorted to make it seem like the character was dancing. This is done as the space bar is pressed, the music starts and the image distorted slightly in one direction and then goes back to normal, as it is set to twist a certain measurement.

This provided the illusing that the character is moving and twisting, a 'dance twist'.

This is a sequence and the steps happen one after another, so the image wouldn't twist again unless the algorritm is set to start again (unless someone presses the space bar again) thereby restarting the sequence.

Keeping score


This algorithm take the score up by 1 everytime the shark eats a fish.
This script is set for the shark so only the shark will move.

The algorithm starts as the green flag is clicked, it sets the score to '0'.
The next part continues on forever as it is shown inside the forever bracked. the shark will continue moving unil the player desiced to stop the game. it won't just move in a straight line it will turn every now and then  as it moves,and IF the shark touches the fish (sprite 3) the score will go up by 1 and there will be a sound played to accompany it, this also let the player know that the score has indeed changed, then the shark will contine to moving.

This is a repetion algorithm, it repaets this sequence till the gammer chosses to end.


Monday, 22 October 2012

Key moves



With this algorithm the cats move around as the arrow keys are prssed.
 
The cats turn exactly 90* when changing directions from up to left or right OR down to left or right.

If the controller pressen up then down/down then up OR right then left/ left then right the character turns exactly 180*

I've set the algorithms for both of the cats, so they follow each other around.

The cats only move around if the arrows are pressed, this is because i set it so the character faces a certain direction and moves forward if i press either the up, down, left or right arrow.

When the 'up arrow' is pressed  the cats point in 0* (which is north/up) and moves 10 steps.

When the 'down arrow' is pressed the cats point in 180* (south/down) and moves 10 steps.

When the 'left arrow' is pressed the cats point -90 (west/ left) and moves 10 steps.

When the 'right arrow' is pressed the cats point 90 (east/right) and moves 10 steps.

The yellow blocks and 'contol' blocks, they provide a means of command for the controler. Then the bluse block (which are motion block) provide intrustions for the character  (how it is to move).








Wednesday, 17 October 2012

Flow charts



Oftern algoritms are written in diagram form through a flow charts. The following task was completed so i could get a basic understanding of how to read a flow chart, the last 3 definitions in the previous tasks alo apply her as the flow charts are written is sequens, can contain selection and sometime include repetition.



Description of flowcharts

Below is a basic flow chart showing the 5 basic flowcharting symbols. (continued below...)


This diagram is typical of most flow charts you will find in process documentation. Using these basic symbols is a simple but effective way to provide a graphical snapshot of a process. The following is an overview of the symbols:

·         The rectangles indicate Process steps.

·         The diamonds indicate Decisions, or branches in the process.

·         The circles indicate Connectors which act as jump nodes from one part of the process to another.

·         The ovals (Terminators) indicate the process boundaries, showing where the process starts and stops.

·         The arrows (Flow Lines) indicate the process flow direction.

 

Questions on Flowcharts

  1. For each of the flowcharts below describe in words what you think they will do.

 

This flow chart will help determine whether it is freezing or not as it will print either “below Freezing” or “above  Freezing”



This flow chart will turn a LED light on and off. Once the light it on, the timer starts and the light remains on for a second until it is off.

How to use word to draw flowcharts

You can go to this link for an explanation of the shapes in word that can be used for flowcharts, just don’t bother giving them your email address.

Then you can use word to answer the following question.

  1. Convert one of the algorithms you have created in the previous task into a flowchart, e.g.  Opening a door, moving through a traffic light.





















Tuesday, 16 October 2012

INTRODUCTION to new topic...


Hey there guys, i've started a new topic, and it's the final topic for the year.
This one is qute interesting and in this post i've got some definations for some simple terms that i'll come accross in this topic.... we're going to be creating a game.


 

“Computers never do what you want them to do,

they only do what you tell them to!”

 

Using the web, find definitions for the following terms and post them on your blog. Make sure the definitions relate to computers and programming

 

1.       Algorithms- A step-by-step set of instructions that describe how to reach a goal. (Can be used by computers or can be a set of instructions to perform, other physical mathematical task by human).

 

2.       Pseudocode- (pseudo= like something, pretending to b something) like code, not real code, computer can’t understand it; a tool used by programmers to describe an algorithm. Contains standard words, like; begin end.

 

3.       Machine Language- code for and algorithm written in a low level language that only the computer understands, i.e. doesn’t have English words in it.

 

4.       High Level Computer Language- contains regular words, like; if, them else...

 

5.       Flowchart- An algorithm described using a diagram, it uses standard symbols e.g.<> vertical diamond symbol is used for selection.

 

6.       Sequence- the order in which the step are carried out

 

7.       Selection- selection in an algorithm is when you have to make a choice between 2 choices, most selections are se up to answer a yes/no question

 

8.       Repetition- when steps are repeated again and again until a condition is met.

 

Then with the aid of class discussions, write an algorithm for the following processes;

1.       opening a door and entering a room.

1)    Turn 90* to your left

2)    Walk 5 short steps

3)    Turn 90*

4)    Walk 3 steps towards the door

5)    Extend arm towards the door knob

6)    Grab door knob

7)    Turn door knob in a clockwise direction

8)    Pull the door knob towards yourself

 

 

2.       Negotiating traffic lights as you drive down a street.

1)    Is the light green?

2)    IF YES, continue driving

3)    IF NO, Is the light red?

4)    IF YES, stop

5)    IF NO, slow down

continue reading and follow me in this new adventure... well more or less :D