Sign in to follow this  
jagguy

web games

Recommended Posts

jagguy    100
I saw some game son the web and it was pointed out they are made with actions scripts in flash. They were 2d scrolling games which look professionally done. q)What i want to know is can actions scipts create this with code or is the code/game created somewhere else and imported. How do actionscripts compare to c++/directx in ease of understanding? q)Can I download any software to do action scripts or do you need to buy flash . I have already used up my 60day trial for flash.

Share this post


Link to post
Share on other sites
kevtimc    230
-Actionscript is writen directly in the flash enviornment, IMHO Actionscript is simpler than C++ and especially DirectX and, it gives you a good understand of how to solve problems using many elements used in C, C++, Java, etc.

-You would have to buy Flash, there is a student version for 100 bucks, I'll look for it a bit later. . .

Share this post


Link to post
Share on other sites
jagguy    100
Quote:
Original post by kevtimc
-Actionscript is writen directly in the flash enviornment, IMHO Actionscript is simpler than C++ and especially DirectX and, it gives you a good understand of how to solve problems using many elements used in C, C++, Java, etc.

-You would have to buy Flash, there is a student version for 100 bucks, I'll look for it a bit later. . .


I am in australia so i doubt it will be that cheap here.
What I needed was to know how to create say 2d simple games using actionscript, given that i can do it in c++/directx . I take it the graphics themselves are created elsewhere and AS just is the engine like c++.

Share this post


Link to post
Share on other sites
Aardvajk    13207
My undertanding or Action Script is that it is "compiled" into a Flash proprietory byte-code that is executed by the Flash engine in a sort of virtual machine set up, similar to Java.

In this sense, it is unlike C++ and, as has been said, you would require the Flash development software in order to write AS programs.

Share this post


Link to post
Share on other sites
jagguy    100
MOst graphics on the net inc. games seem to be in flash. Java was supposed to be the thing to do this but flash now seems the standard.

It is learning how to do at least 2d games is what I want to find out in flash.

Flash professional academic is selling for $360 Australian which is about $250 US, if anyone tell me where i can get a cheaper version (within the law) I would be happy.

[Edited by - jagguy on August 18, 2006 5:52:54 AM]

Share this post


Link to post
Share on other sites
abstractworlds    194
The Flash swf file format is to some extent an open format. This means that you dont need to purchase Flash to make Flash files. There are other packages from other vendors which can create Flash files too.

For gaming, where most of your flash will consist of actionscript code, you may want to consider:

www.mtasc.org

which is a free open source actionscript 2 compiler

and

www.swfmill.org

for compiling resources.

This setup isn't going to be as friendly as the Flash environment, but for programmers looking for a free alternative it might be worth considering.

Share this post


Link to post
Share on other sites
password    181
The flash environment consists of a scene and a timeline which makes it possible for animation. In order to create games, the most common thing is to create Movie clips which are like objects. They can contain code themselves and also an instance name which you refer to in other objects. Every frame in the timeline can also contain code.

If you have a player character for example in a scene with one frame. You could add code into the player itself, for example code that makes it change x position with the arrow keys.


onClipEvent(enterFrame) {
if (Key.isDown(Key.LEFT))
this.x-=2;
else if (Key.isDown(Key.RIGHT))
this.x+=2;
}




onClipEvent(enterFrame) is almost the same thing as a game loop, it processes the code all the time. Frame code could be used to redirect the flash app to the first frame, or make the app stop at a certain frame. This can be used to make every frame a new level.

Objects interact with each other by referring to their instance name. Let's say you add a wall Movie Clip and add collision detection in the wall. Then you could do something like this in the wall MC code:


onClipEvent(enterFrame) {
if (this.hitTest(_root.player)) {
// collision
}
}




In this case _root.player was used to refer to the player Movie clip. Flash is very easy to work with because you can see everything and organise the code into many pieces. Think of it as an image editing program, where you can drag and drop and create objects which you can put code into. Everything is visible and every frame can represent a new scene if you make a game. I think the code is somehow similar to javascript and slightly similar to c++ in some ways.

http://www.flashkit.com is a good site where you can learn more about actionscript.

Share this post


Link to post
Share on other sites
jagguy    100
Quote:
Original post by abstractworlds
The Flash swf file format is to some extent an open format. This means that you dont need to purchase Flash to make Flash files. There are other packages from other vendors which can create Flash files too.

For gaming, where most of your flash will consist of actionscript code, you may want to consider:

www.mtasc.org

which is a free open source actionscript 2 compiler

and

www.swfmill.org

for compiling resources.

This setup isn't going to be as friendly as the Flash environment, but for programmers looking for a free alternative it might be worth considering.


Ok so I didn't know this.

q)I am confused about www.swfmill.org as I don't understand what this does. The other www.mtasc.org seems to be the standard to use, and what drawbacks does it have.

q)I want to learn actionscript to create simple 2d games that can be used on a website. Will this (www.mtasc.org )allow you to do that and do you need flash at all to include it in a website.


q)can i get a graphical ide for the open source compiler, i tried http://www.protozoo.com/ and didn't find a thing.

Share this post


Link to post
Share on other sites
abstractworlds    194
mtasc is used mainly to compile your actionscript source text files and create a Flash swf. swfmill is mainly used to create a Flash swf file from other non-actionscript resources, like graphics, fonts, etc.

You could probably get by without swfmill if you load your jpgs etc at runtime using actionscript commands rather than embedding them into your swf. Since actionscript source files are text files you can use any text editor including notepad.

There are drawbacks using mtasc, including no friendly IDE, no support, slightly different code in some places than standard Flash acionscript code, etc. ... but it is free.

Share this post


Link to post
Share on other sites
abstractworlds    194
plus you dont need Flash to include it in a website. The swf files that mtasc creates are standard Flash files, you just upload to your site and use the appropiate HTML code to embed them. Visitors only need the standard Flash runtime to run your game, and you can use MTASC to target different versions of the Flash runtime (e.g. Flash 6).

Share this post


Link to post
Share on other sites
jagguy    100
It seems quite promising AW so thanks.
I get a lot of help from UK/US.

I downloaded mtasc as compiled it to a bat and it worked with the example. It created a swf file and it played in the flash player.

Now if I had a graphic to load like a .png,.jpg,.tga do I just include the file in the same directory as the .as file to load? I have to get a action script book to work out how to use it.

I would want to embed graphic files into .swf for ease of use on the web but before i do this I need to learn actionscript.

Share this post


Link to post
Share on other sites
abstractworlds    194
I think mtasc is only used for compiling actionscript into swfs. To embed other graphics into a swf use swfmill first, the resulting swf can then be used as an input to the mtasc compile process (mtasc -swf commandline parameter). Alternatively there are actionscript commands to load say jpgs at runtime (e.g. loadMovie). That's about as far as my knowledge goes - its best to google mtasc forums and samples for further information.

Share this post


Link to post
Share on other sites
abstractworlds    194
I think that trying to get jpgs loaded and useable within your game, for anything more than just a static background, may be a bit advanced to start with (and to be useable may involve advanced techniques like preloaders, events, etc). You may find it easier and less offputting when beginning to learn Actionscript just to use shapes that you draw within the code, with commands like e.g. createEmptyMovieClip, beginFill, moveTo, lineTo, endFill, etc.

Share this post


Link to post
Share on other sites
jagguy    100
I agree , I will just learn basics first before wondering about more detailed questions.

q)Now, when compiling the file how can I get it to open in the desired program eg a notepad file with the as file automatically tries to open in flash expired trail version. I want to open directly into my IDE of choice.

q) how do switch the console window to a window and white background and not regular DOS like environment, when compiling the mtasc file .

q) I am used to working with express c++ so the IDE doesn't have to be fancy.

q) what is the difference between flash mx 2004 and flash prof? what should I be using for high level animation and what limit is there graphics wise comapred to directx?

Share this post


Link to post
Share on other sites
abstractworlds    194
Your first 2 questions are general windows questions. In windows explorer right click on .as file, select properties, then 'opens with'. If dos box is fullscreen press Alt + space to bring up menu, then click on properties.

I cant comment on your other questions, since I dont use an IDE (just an editor), and I dont use flash for games. Your flash version question can be googled. Flash and DirectX are different technologies, the best thing to do is look at existing Flash games to see what kind of thing is possible.

Share this post


Link to post
Share on other sites
BUnzaga    267
Ive been playing around with DX Studio, the IDE is built with C++ and the script is some sort of variation of C# or java or something.

Anyway, its been fun for me, now Im learning c#.

http://www.dxstudio.com/

Share this post


Link to post
Share on other sites
jagguy    100
When you compile the .bat file for actionscript as previosly mentioned, the errors come up in the command prompt window.

q)Can the errors from the compilation appear somewhere else like in the editor or anywhere else? In c++ you have the errors appear in a bottom window. With this you need to set up .bat file and run the file and the error appear in command prompt.

It is a good system but a little fiddly if you compile so can this be simplified?

q)Is dx studio an application creates graphics using directx or some directx. That can be used in a directx program and not a standalone new drag-drop program builder? It also mentions collision detection, pixel shaders so i am a little confused about its capabilities. I take it you couldn't use these graphics with flash on the web because you are assuming directx is installed on machines.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this