Here are some great 2DIY activities that let you make your own robot, created by Year2 children at Winchester House School.
View their creations here
« October 2010 | Main | December 2010 »
Here are some great 2DIY activities that let you make your own robot, created by Year2 children at Winchester House School.
View their creations here
Posted by Xannov in 2DIY Examples | Permalink
Reblog (0) | | Digg This | Save to del.icio.us |
Here's the fourth in my series of tutorials aimed at helping 2DIY users to use, and understand, actionscript within their creations.
This tutorial deals with creating elements that you can make appear transparent within your activity.
Outline
In several 2DIY activities, you can make elements appear see-through with just a small amount of code. This is great for Hallowe’en style activities.
Code Explanation
If you right click on the green ‘play’ triangle you can add additional code to the start up script of any activity, and here we can set a rule to make particular elements appear see through.
Tutorial
Create an activity. Add an apple element to the screen, and then right click on the green ‘play’ arrow at the top of the activity. Add the following code below the code that is already present;
s13._alpha=50;
s13 (this is the identification value for each element you add to your activity - see the table at the end of this tutorial for the identification value of elements in various activities)
._alpha= (this is the amount of transparency that you are going to give each element. Setting the alpha value to be 0 will result in a transparent element that cannot be seen, setting the alpha value to 100 will make it a solid colour)
NOTE: there is no _ before the s13 part of the code.
Now press the play button, and watch the apple elements on screen - they are partly see through. By varying the value of ‘alpha’ you can make the elements appear more or less see through.
What does this do?
You are telling the computer to set a transparency value to each of the identified element (the s2 element). This has to be done in the start code section, so that each element can still be given animation, as normally you would enter the animation code in the “ADV” option of each elements animation settings.
Task
Create a platform game themed around a haunted house. Add some apple elements, and give each an animation property by right clicking on each apple and choose the animation (the second) option. Choose from the options available. Place your character at the bottom of the house.
Now run your game - the apple elements will appear slightly see through, and look ghostly as they move about the screen.
Notes
The value of each element (starting with ‘s’) is as follows for each different type of activity;
In Collecting and Journey Activities;
In Platform, Snake and Maze Activities;
As you can see from the image above right, the ID values start with the first column and work their way down, and then move onto the second and third columns. However, if you are struggling to identify an element, right click on it, choose the animation settings, and select “ADV”. Use the code editor (the spanner), and click on the first drop down menu. You should then see the ID for that element.
You can find out more about this feature in this article
Posted by Xannov in Tutorials | Permalink
Reblog (0) | | Digg This | Save to del.icio.us |
Here's the third in my series of tutorials aimed at helping 2DIY users to use, and understand, actionscript within their creations.
This tutorial is an advanced tutorial and deals with creating 'apple' elements that will move away from your character as you approach them.
Outline
In a 2DIY platform, collecting, journey or maze game, you can make the challenge much harder by placing a collectable (apple) element that will move away as your character approaches it.
Code Explanation
If you right click on an apple element, you will see the options for how to make the apple element behave (the second option). Within this option there is an ‘advanced’ (ADV) setting where you can enter ActionScript code, and here we can set a rule to make the apple move away from the main character as it approaches).
Tutorial
Create a collecting activity. Add some apple elements to the screen, and then right click on each apple and look for the animations settings option (the second option). Choose the advanced (ADV) option. Unfortunately for this code you are unable to use the code editor (the spanner icon) to help you add the code. You will need to enter the following code carefully line by line (If you are using this in a journey game you need to change _root.player with _root.car)
if (( Math.abs(_root.player._x - this._x) < 100) and ( Math.abs(_root.player._y - this._y) < 100)) {
var angle = Math.atan2(this._y - _root.player._y, this._x - _root.player._x);
this._x += Math.cos(angle)*2;
this._y += Math.sin(angle)*2;
}
if (this tells the computer that there is a condition that will decide whether the code is to be run or not)
((all the code written between these double brackets)) (these are the conditions that need to be met before the code will run)
Math.abs(_root.player._x-this._x)<100) (this means the absolute value of the horizontal position of the main character must be less than 100 pixels from the apple element)*
Math.abs(_root.player._y-this._y)<100) (this means the absolute value of the vertical position of the main character must be less than 100 pixels from the apple element)*
*the Maths.abs value simply means that if the value of the distance between the main character and the apple element is a negative number, it will be read as a positive number, ie -3 will be read as +3
and means that both conditions must be met for the code to run
{ all the code written between these brackets } (this is the code that will run IF the conditions set out above are met)
var angle = (this a variable called “angle” that is being defined)
Math.atan2 (this is a mathematical function - it works out the value of the tangent between two points to create an angle)
this._y - _root.player._y, (the vertical position of the main character is subtracted from the vertical position of the apple element for one of the points in the tangent calculation)
this._x - _root.player._x (the horizontal position of the main character is subtracted from the horizontal position of the apple element for the other points in the tangent calculation)
this._x += (this gives the apple element a new horizontal value to appear on screen at)
Math.cos(angle)*2; (this mathematical function sets the horizontal value for the position of the apple element)
this._y += (this gives the apple element a new vertical value to appear on screen at)
Math.sin(angle)*2; (this mathematical function sets the vertical value for the position of the apple element)
Now press the play button, and move your character. You will notice that the apple moves away from the main character .
What does this do?
You are telling the computer to constantly check through a rule. The rule uses a condition, and it checks that the condition has been met before its code will run. It works a little like this;
IF ((the green man has come on) AND (the traffic has stopped))
{ now cross the road carefully }
In other words, the ‘cross the road’ part of the instruction will not take place unless the other two conditions (green man AND traffic) have been met.
Task
Create a maze game with several ways to travel around the maze. Add some apple elements. Each apple element needs to be placed randomly around the screen. Place your character in the centre of the maze.
Now run your game - as you try to collect the apple elements they move away from you. Some may travel through the maze walls, making it harder for you to collect those elements quickly.
Notes
If you are really unlucky, you can push the apple elements off the game screen - making them un-collectable. Try to place them away from the screen edge to avoid this.
You can find out more about this feature in this article
Posted by Xannov in Tutorials | Permalink
Reblog (0) | | Digg This | Save to del.icio.us |
Winchester House School have been busy using 2DIY recently. They've been recording what they have done on their school ICT blog.
- Year 7 have been using a program called 2DIY to create platform games. To begin with they sketched out their ideas on paper. See the images of their ideas here and their work here.
- Year 1 used 2DIY to create robots. They began by drawing different sections of their robots such as heads, bodies, arms and legs and then dragged and dropped these sections to create different robot designs. See examples here.
- Reception have been creating jigsaw puzzles on the computers. They have used a program called 2DIY to create pictures that can then be turned into jigsaw puzzles. See their work here.
Posted by Xannov in 2DIY Examples | Permalink
Reblog (0) | | Digg This | Save to del.icio.us |
Try these 2DIY games, created by the pupils in class8 at St John the Baptist CofE Controlled Primary school. Click here to access their games.
Posted by Xannov in 2DIY Examples | Permalink
Reblog (0) | | Digg This | Save to del.icio.us |

Recent Comments