ActionScript 3 trying to clone google Halloween game - actionscript-3

This past Halloween Google put out a game that used drawn symbols to initiate a function. Using a mouse or drawing table, the game would recognize x, o, <, >,- or |... each enemy had one or more of these symbols above them and had a hierarchy from left to right. As you drew a symbol each enemy with it as their left most would suffer an attack.
Is this possible in actionscript 3? I can't find any resources to help
If it is how complicated can the symbols be?

You can do this with a gesture recognizer like $1 Recognizer. There is a Flash example with source code linked from the project page.
Once you get it working you can train it to recognize whatever gestures you want to use in your game.
This works really well, because the gestures can be recognized even if they are drawn at a different scale or rotation than the original.

Related

Action Script 3 - how to pass variables through multiple scenes

I am using flash cs6 and making a game in which some squares are falling down randomly and we have a wall that is controlled by the mouse. Every square we dodge 10 points are added to the score. If the squares touch the wall then we go to another scene called the "the end" scene in this scene we display the score to the player. So I want to pass the score variable to that scene. I have tried googling it a lot of times but it couldn't help. So my only hope is you guys. Please help.
How do I go to the next scene:
if (wall.hitTestObject(square))
{
gotoAndStop(1, "The End");
}
Instead of using flash to create games like this you can Game Maker it is more efficient.
You can go to its website yoyogames.com
Adobe Flash Professional Creative Suit series are for designers, animators. It is one of the worst IDEs for a programmer (notepad would be better). I'd suggest you to get a better IDE like Adobe's Flash Builder which is more suitable for programmers or search for other 3rd party IDEs like IntelliJ Idea which is one of the best from my point of view.
Instead of programming on timeline and using scenes which is for animators, get into the Object Oriented Programming, start with the basics, the classes, then move on with design patterns etc.

HTML5 chinese chess board and pieces

I have a project about chinese chess.
First I have to create a board and about 32 chessman on board .
Should I using 1 canvas to create board then draw 32 images on it OR create 1 board canvas then create 32 canvas , each for 1 chessman . Because I want to drag and drop chessmans but it seem not well when I have to redraw too much if just use 1 canvas. What should I do , can u give me some advices or give me some same tutorial . Thanks!
KineticJS is a Javascript library that will help you out. It supports dragging of things on canvases, etc. Here's a simple tutorial using Kinetic and an HTML5 canvas: http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-tutorial/
This might be a matter of preference, so take it with a grain of salt. I would only use one canvas and draw the pieces directly onto it.
In most games (HTML 5 included), the rendering is all pretty "smoke and mirrors", and the real data is stored in ugly structures behind the scenes. Trying to use multiple canvases pulls some of that data (specifically location) and mess into the rendering layer. While this can probably still work, you'll have more control over whats happening if you keep all the data behind the scenes, and use math to determine where to render and whether or not a mouse click has hit an object and you need to start dragging.

coloring multiple frames in Flash Professional CC

I'm brand new to Flash Professional and wanted to make a short 10 second clip. Instead of looking into using tweens and symbols (I wish I did) I used Flash Professional as a flip book, illustrating sketches for each keyframe.
I'm now in the colouring process and want to know if there is a way to colour an object (I've drawn with the brush tool) throughout multiple frames. is this even possible?
I understand there are some short cuts to repetitive tasks using ActionScript. But, once again I am brand new to Flash Professional and haven't tried anything in the ActionScript. I do however have a very basic knowledge of HTML coding and some javaScript if it helps at all…
If there is an alternate solution like exporting the file to another Adobe program that has a "colouring multiple frames" feature, that would be great too.
Sorry to say, to do that, you WILL have to work with symbols. However, this is an easy fix.
Select the object you want to color, click Modify--> Convert to Symbol. Give it a good name, and set it to MovieClip. Click OK.
Now, in the Library panel, double-click the icon next to your symbol name. Color as you wish.
There are multiple ways to put this on your timeline. You could replace each instance of that drawing with the symbol. Or, better, you could create a new layer with only one keyframe (and regular frames after that to the end of your animation. Place your object on that layer, and then remove all the old versions of that drawing.
NOTE: You will need to be mindful of where in the stack you put layers, as that sets the z-index of everything on that layer.

Working with Graphics in Actionscript

i haven't worked with graphics until now.. so I have not much ideas about using graphics objects in flash cs6.
I want to move this character depending if the person has pressed a button and stop his movement once the button is released. I looked up on how to go about this process.. so far one thing that kept coming up was to turn my spritesheet into graphics.. but after that i couldn't really find anything on how to integrate this into actionscript. Plus when I convert an object into graphics it doesn't give me options to assign it a class name. so can somebody give me a good breakdown on what is the purpose of these graphics objects? and how should I go about making a sprite move?
Disregard information concerning sprite sheets. These are used as a completely different method of graphics rendering that I'm not going to cover here; for more advanced, high performance applications and games.
When you say Graphics, I am assuming that you mean you've created some drawings that you've converted to a Graphic like this:
These types of objects are used purely for timeline animation. What you want to use here is the type MovieClip. When you use this type, you'll be able to give the object a class name like you mentioned:
After doing this, you'll be able to refer to that library symbol in ActionScript like this:
var gr:MyGraphic = new MyGraphic();
addChild(gr);

AS3 - Moving a line through guide

I'm trying to animate a nodal with flash for teaching purposes. This is what I want to animate:
My questions:
How can I move the line through a guide?
Can guides hold z positions, so I could make the rope's top and bottom parts more real?
Can a vector image (rope) move through a guide path?
Which way is this possible, strokes or brushes?
Does as3 scripting support "decorated brush" effects?
Is there a simpler way to do this such as sandy or awake3d or beziercurves?
If you're using the IDE like CS4 or CS5 there are some menu options to do this. I only use a text editor and Flex SDK to compile. While I know what you're talking about, I can't really answer this one since I don't have the program. There's plenty of tutorials on the subject, however.
I believe the path-following tools in CS* only follow (x,y) coordinates. No Z values in the menus, but you can code them yourself. Again, I don't have the program, but from the tutorials I read it looks like no.
I suppose it could. Instead of a line drawing like you have here, you could simply use an image of one rope segment (as in a picture of rope whose length is equal to one twist of the rope), then apply transformations to get the correct 3D perspective.
Basic flash programs only draw fills. You can, however, run a shader program (called pixel bender) within flash which will draw strokes for you.
Not on it's own, no. But there is nothing stopping you from programming your own decorated brush class.
Bezier curves are probably the way to go.