You Are Here:

Community: Wiki

This page was last modified on 19 September 2009, at 08:06.

How to make dynamically game in Flash Lite 1.1.

From Forum Nokia Wiki

Reviewer Approved   

Flash Lite 1.1

Contents

Develop game

You want to put graphics into your game, but the graphics would be too large for device to render. But, these graphics make game very heavy and run slow on devices. Then, what to do?

Make a single graphic reuse it and duplicate the graphics to make a big scene.

You can see that all boxes are 16x16. And all graphic boxes are same as 2,4,8 are all same graphics. But make a big picture

You want to reuse the graphics in different area of your game canvas. You have created the tiles.

Tile game


You can also replace the graphics of your game. You don't have to redraw it again. You can just replace it. Also insert new graphics box in game. You got all tile boxes axis, point and tile numbers


You have to draw a rectangle box 16x16.

Make as a vector graphic, not raster graphic because vector graphics are render fast then raster graphics on device. Use raster or vector graphics it depends on the situation or device.

Create a movie and give instance name "tile"

And create a movie and write a Frame code.

You want to draw a one graphic tile around the canvas like a boundary.

First, draw form top Top Left is 0 and Right left corner 176.

Write a code

for (p=0; p<=176; p+ =16){
//16 is box size
a++
//a++ is increment of duplicate.
duplicateMovieClip("tile", "tile_a",a);
//tile_a is name A unique identifier for the duplicated movie clip.
//a is depth. A unique depth level for the duplicated movie clip. The depth level indicates a stacking order for duplicated movie clips. It is same as stacking order of layer in the timeline.*/
/:p=p;
tellTarget("tile"){
_x=164;
//Draw tile in X axis
_y=0
}

Same as for other side.

Add this code

//Top
for (p=0; p<=176; p += 16) {
a++;
duplicateMovieClip("/tile", "tile_a", a);
/:p = p;
tellTarget ("/tile") {
_x = /:p;
_y = 0;
}
}
//Right
for (p=0; p<=176; p += 16) {
a++;
duplicateMovieClip("/tile", "tile_a", a);
/:p = p;
tellTarget ("/tile") {
_x = 164;
_y = /:p;
}
}
//Left
for (p=0; p<=176; p += 16) {
a++;
duplicateMovieClip("/tile", "tile_a", a);
/:p = p;
tellTarget ("/tile") {
_x = 0;
_y = /:p;
}
}
//Bottom
for (p=0; p<=176; p += 16) {
a++;
duplicateMovieClip("/tile", "tile_a", a);
/:p = p;
tellTarget ("/tile") {
_x = /:p;
_y = 192;
}
}

Download

you can download an example with source code here: [Dynamically.zip]


--Narender Raul

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fAccessingE5fsystemE5fresourcesE5fwithE5fPyS60E5fonE5fS60E5f3rdE5fE45ditionE5fdevicesX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtopicQUqfnTopicZflashE5fliteQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ