Release of Flash Script Engine legendforflashprogramming0.1

Source: Internet
Author: User
Tags custom name

I. What is the legendforflashprogramming script engine?
It is a game script engine developed with actionscript3.0. All the elements in the game can be controlled by the script language. It can easily create an SLG game, even if you do not write programs at all, this reduces the difficulty of game development.
2. What kind of game can this engine make?

In version 0.1, you can create an LVG game or a small SLG game (similar to the Three Kingdoms Cao Zhuan series ), later versions are planned to support the development of large SLG games (similar to the Three Kingdoms series), RPG games and MMO-RPG games, and other new features.

3. Why is it version 0.1 instead of 1.0?

Although the current version can freely create a game, it is not convenient in some places, such:

1. Currently, in addition to maps, Flash Professional csseries tools are required for adding and modifying images in the game. Therefore, we are going to change the image storage format in Version 1.0, provides image modifiers for games.

2. The game's strategies and special effects are not complete enough. You are ready to add a large number of policies and special effects to analyticdb 1.0.

For the above reasons, we will release version 0.1 first. If you have the opportunity, we will prepare a dedicated game Script Editor.

4. Cases of this engine

3 kingdoms yellow towel chaos

Http://blog.csdn.net/lufy_legend/article/details/6889261

5. Engine script syntax

The engine uses the L # scripting language version 0.1 (the scripting language specifically designed for the engine), L # The scripting language is updated with the engine update. The following describes the syntax of the script, you don't need to understand it all, let alone remember it all (in fact, I don't have to list it all). When making a game, you don't have to use it all. How to use this script to create a game, we will also provide detailed tutorials and learn more when using them.

 

L # BASIC script syntax

I. Code comments

In the L # syntax, you can use "//" to annotate a line of code, and "/**/" to annotate multiple lines of code.

For example, the following code is valid only for the first line:

Button. Add (-, btnstart, Game start, 280,270, btnup, btnover, btnover, # ffffff );

// Button. Add (-, btnload, read progress, 280,310, btnup, btnover, btnover, # ffffff );

/*

Button. Add (-, btnset, Environment setting, 280,350, btnup, btnover, btnover, # ffffff );

Button. Add (-, btnbuy, partner, 280,390, btnup, btnover, btnover, # ffffff );

Button. Add (-, btnover, close the game, 280,430, btnup, btnover, btnover, # ffffff );

*/

2. Variable operations
1. Variable assignment
Var. Set (name, value );
Parameter: variable name, Value

For example, var. Set (N1, 100); var. Set (N2, "ABC"); var. Set (N2, ABC );

Note: In L #, the strings "ABC" and ABC are actually not equal.
2. Variable usage
@ + Variable name

Example: If (@ test = 0 );

 

3. conditional statement if
The IF statement starts with IF and ends with endif. Each clause ends ";".
Example:
If (@ test = 0 );
Var. Set (backwidth, 100 );
Elseif (@ test = 1 );
Var. Set (backwidth, 400 );
Else;
Var. Set (backwidth, 700 );
Endif;
Note: If the variable test is equal to 0, the variable backwidth equals 100. If the variable test is equal to 1, the variable backwidth equals 400; otherwise, the variable backwidth equals 700.

4. Goto statements
1. Define mark. Married; (married is a custom name)
2, Mark. Goto (married); jump to the defined position
Parameter: Location of the custom name

5. Load: File Load class, used to read files and Images
1. Load. Script (PATH );
Load script files
Parameter: script file path, for example, data/script/Main. Lf
2, load. IMG (name, PATH );
Load Image
Parameter: Data name after the image file is loaded, image path

6. function: add method, ending with endfunction;, in the following format:

Function btn01click ();

Text. windchange (talk, 30 seconds or more !);

Layer. Remove (select );

Endfunction;

7. Call: Call Method

Call. btn01click ();

8. Wait: The game is suspended and enters the waiting state.

1, wait. Click ();

Wait for the mouse to click

2, wait. Time (30 );

Wait 30*10 milliseconds.

9. layer: operation layer
1, layer. Add (-, name, 0, 0 );
Add layer
Parameter: layer name (if yes-, add it to the grass-roots layer), add layer name, add layer coordinates
2, layer. Remove (name );
Remove Layer
Parameter: Remove layer name
3, layer. Clear (name );
Remove all child components from this layer
Parameter: Remove layer name
4, layer. Clear (name );
Remove all child components from this layer
Parameter: Remove layer name
5. Change transparency
Layer. Transition (name, fadein, 0.1 );
Parameter: layer name, type, speed
Layer. Transition (name, fadeout, 0.1 );
Parameter: layer name, type, speed
Layer. Transition (name, fadeto, 0.1, 0.5 );
Parameter: layer name, type, target transparency, speed

10. IMG: Image operations

1, IMG. Add (-, logoimg, logo, 800,480, 1 );

Show an image

Parameter: layer, image name, image data name, coordinate X, coordinate Y, width, height, transparency

2, IMG. changedata (backimg, backdata01 );

Change image data

Parameter: image name, image data name

3, IMG. Remove (IMG );

Remove Image

Parameter: image name

4, IMG. moveTo (gril, 400,150, 10 );

Remove Image

Parameter: image name, moving destination X, moving destination y, and moving speed

5. Change transparency

Layer. Transition (name, fadein, 0.1 );
Parameter: layer name, type, speed
Layer. Transition (name, fadeout, 0.1 );
Parameter: layer name, type, speed
Layer. Transition (name, fadeto, 0.1, 0.5 );
Parameter: layer name, type, target transparency, speed

11. Button: button operation class

1, button. Add (select, btn01, male, 0, 10, selectbtnup, selectbtnover, selectbtnover, # ffffff );

Add a button

Parameter: layer, button name, button text, button image up status, button image over status, button image down status, button text color

2, button. Remove (btn01 );

Remove Image

Parameter: image name

3, button. mousedown (btn01, btn01click );

Add button mouse_down event

Parameter: button name, Method Name

4, button. mouseup (btn01, btn01click );

Add button mouse_up event

Parameter: button name, Method Name

5, button. Mouseover (btn01, btn01click );

Add button mouse_over event

Parameter: button name, Method Name

6, button. mouseout (btn01, btn01click );

Add button mouse_out event

Parameter: button name, Method Name

12. Text: Text operations

You can directly display all of them or display the text literally.

1, text. Label (talk, name01, [lufy], 120,360, 15, # ffffff );

Show text

Parameter: layer name, text name, text information, coordinate X, coordinate Y, font size, font color

2, text. labelchange (name01 ,[??? ], 15, # ff0000 );

Change text information

Parameter: Text name, text information, text size, text color

3, text. Wind (talk, talk, please wait too many minutes! 「 Legend has never seen the world! <Spanclass = 'red'> lufy </span> when the token is used. When there are too many threads, L # when there are too many threads ., 120,380,380 );

Add text and display it word by word

Parameter: layer name, text name, text information, coordinate X, coordinate Y, text box width, font size, verbatim display speed

When text is displayed verbatim, CSS in L # can be used to change the color of individual texts, for example, <SPAN class = 'red'> lufy </span> indicates that the letter lufy is displayed in red. Other colors include red, yellow, green, blue, pink, and black.

Thirteen, there are all the scripts corresponding to the small SLG, about 20 in the main category, and several methods in each class. These will be detailed in the next SLG tutorial.

 

6. Create a hellow world applet.

Or download some other demos created by this engine.

1. Create a folder named "hellow" first, and then put" sanguojiforpc.swf "in the folder.

2. Create a script folder in the hellow folder and create a text file mainslg in the script folder. lf, the extension is changed to LF here, because the legendforflashprogramming engine uses the L # script language and the L # script file extension is lf.

3. Open mainslg. lf in notepad and add the following line of code in it.

Text. Label (-, txt, hello World !, 280,230, 30, #000000 );

Now open sanguojiforpc.swf and we should see the familiar "Hellow World.

How to Use legendforflashprogramming to create LVG games

How to Use legendforflashprogramming to create SLG games

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.