Wednesday, December 24, 2008

How to Make Random Movement

Random movement appear everywhere. From school of fitutor 4-1sh under the sea, flies and bees in the air to molecules of water in the bottle. Random movement is complex matter and we must define specifically for every kind of object.

There are three types of random movement. First, random speed of object. Object that move with non constant speed. In 2D animation, the ant movement maybe fall into this category. Second, random turn or changing direction of object. We can see it from fish and other animals. Fish will move with constant speed but they change their direction of movement in sudden. And the third category is random speed and turn. Many kind of insect that can fly fall into this category, like butterfly, bumblebee, and flies.

The key to build random movement lies on this "pick random ... to ..." blockpick random. But this random number must be convert into random movement or random turn with IF THEN rule. There are many way to make conversion. The basic rule is to define how frequently the changing happens. If the smaller occurrence chance of a change , the smaller value of the fraction of possible change that will occurred. The change occurrence value of 1/2 to 1/6 represent that it happens very often, and the change occurrence value of 1/10 or 1/15 represent that it rarely happens. Divisor number showed by the value of picking random number. So if more rarely change happens, the value of picking random number will be greater.

Maybe it is too technical, so we will learn this concept through example of fish movemtutor 4-2ent. This is the second type of random movement, so we only have to randomize the turning behavior. Many fish changing their direction of swimming frequently so we choose random number between 1 to 6. Now we can develop the stack of random movement completely. Is it easy?

Click Here to Read More..

How to Make Object Following Mouse Pointer

Do you ever play FishChomp games in Scratch that the big fish have to eat small fish by following the mouse pointer? Or have tutor 3-1 you imagined your bee looking for pollen in the flower by following the movement of the mouse pointer? Interaction between mouse pointer and Sprite objects are very important in creating video games. But we are only know how to build behavior of single Sprite until now. We still don't understand how script from one Sprite could interact with other object.

Now let's we try. This interaction can be build with three step of logics. First, we must changing the direction of the Sprite object towards the mouse pointer. We can do this by using "point towards mouse-pointer" blockpoint towards. Don't forget to click the down-arrow and choose mouse-pointer from the list. Second, we have to move the Sprite object in that direction several steps. We can get this by picking "move ... steps" block move. And the last step is adjusting the distance and speed between the movement of mouse pointer and the movement of our Sprite object. This can be done with delay block wait . But we have to make some experiment to determine how much step and how long the delay every cycle of program, to find the best response of our object to the movement of our mouse pointer.

We have develop program that produces the effectstutor 3-2 of the interaction. Now you can feel how easily the program interaction between Sprite objects and mouse pointer in the Scratch. You can use this stack for various effect in your games.

Click Here to Read More..

How to Make Walking and Flying Object

Almost every games need a walking and flying objects. In 2D animation, walking and flying object is very easy to make. Basically, you have to draw several costumes for every walking and flying position of your object. For this time, I will show you how to make walking object and flying object with just twtutor 2-1o costumes only. This is enough for beginner.

From the default Costumes Folder of Scratch, you can find simple two different image of moving objects. I will pick flying bat for my example. You can use many kind animals within that folder.

The technique is to switch the display of our object's costumes so that we can imagine that it is moving. You can do this by using this simple blocknext costumesfrom Looks Palette. If we have more than two costumes, this block still can be used too. But you must remember that execution time of computer is very fast. If we are switching between costumes without delay, our object will move so quickly that can not be seen. So we must insert delay block wait between costumes. How long we must delay? It depends on your purpose. But typically not more than 1 second. Don't forget, at every turn of the costumes, we also moved the objects to step forward. You should use this blockmove from Motion Palette.

Now come the last question. How to automatically changing the direction of our objeSprite featurects when they are touching the edge? The answer is simple. You can insert block "if on edge, bounce", like what we have done with bouncing ball. But you must pay attention on the Rotation Style of Sprite which located in the top middle of Scratch console. There are three button from the top: can rotate, only face left right, and don't rotate. You must stutor 2-2elect the middle button that showed by red arrow so that the Sprite only can move left and right. If you choose the top button, every time our Sprite bouncing on the edge, it will be rotated 360 degree and become upside down. You can see how funny it is look.

Finally we should get complete stack of blocks for our sprite that make a whole walking or flying animation, like this. There are other way too, and ytutor 2-3ou can find it, but it is the easiest way. Remember, the more costumes you are using for walking or flying animation, you will get the result more smooth and compelling. In the professional games, animator can use tens of costumes for only just one Sprite!

Click Here to Read More..