A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5828 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


Random Links | Add your own Flash Related Links
Flash Tutorials 1280 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories Building a Text Game
Author: Troy Limacher | Website: www.geocities.com/helenandtroyuk |

 
Page 3
«prev 1 2 3 4 next»

Creating new rooms

This might seem a bit long or complex to start with, but it is very easy.  It is all cutting and pasting.
To create a new room you just need to copy & paste the section of script in the 2nd keyframe that reads -

if (_root.Place == 0) { //First room
 _root.texty = "You have no idea where this place is.  Bright light illuminates the room from a strange pyramid shaped bulb overhead.  You squint at it but realize that this is unnecessary as the light is quite comfortable to look at directly.  The room is quite bare, there is a door to the right.";
 // IMAGES
 _root.image1._visible = true;
 ///////////////////////////
 if (Key.isDown(Key.ENTER)) {
 if ((_root.inputy == "open door") or (_root.inputy == "go right") or (_root.inputy == "right")) {
 _root.Place += 1; //Go to Second Room
 ResetAll(); // Go to function in keyframe 1
 }
 }
}

The Place variable is a scene or room in the game.  Change this to another number, describe the new room in
texty which then copies over to the textbox. The inputy line defines how to get to the new scene, you can write
anything in here, 'north', 'south', 'open door' etc.
If you have an image for this scene set it to visible here but make sure to set it to visible = false in the ResetAll function, keyframe 1.

Creating new objects

To create a new object first specify which room or Place it will be found in.  Copy this line of script you can
see in the first few lines of keyframe 1.  Change the name to Object2Position = (Place to be found);

_root.Object1Position = 0;

Also copy and change this variable to object2.

_root.Object1 = 0; // Ensure First Object actions only occur once.

In the AddObjects function, copy and paste the following code, then change the variable for object1Position to
object2position and change the "box" description.

if (_root.Object1Position == "bag") {
 _root.listbox1.addItemAt(0, "box"); //Update items held box
 }

Then copy the following script found in the OBJECTS section of script, keyframe 2 -

if ((_root.Object1Position == _root.Place) and (_root.Object1 == 0)) {
 _root.objecty = _root.objecty+"There is a SMALL BOX SHAPED OBJECT on the floor";
 _root.Object1 = 1; //the purpose of object1 is just to ensure that this line is added only once.
}

Add a number to the variables (object1Position will be object2Position, etc.).  Add a description for the object in
objecty. Then copy the sections below this and just change the variables & descriptions to suit the new object.  This
will define how to get, drop and use the object.  Obviously you can create any commands you want, throw object, move
object, push object, etc.  There are 2 responses for the 'use object' input, if you are not in the right room when
you use the object you need a response to say 'The object doesn't work here.'

«prev 1 2 3 4 next»

» Level Intermediate

Added: : 2003-10-20
Rating: 6.49 Votes: 36
Hits: 1257
» Author
I write Flashscript for a plasma screen in the CTRL Project in London.
» Download
Download the files used in this tutorial.
Download (162 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs