Shop Mobile More Submit  Join Login
Here's a preview of a game that is currently in the works. It's in the disguise of a tutorial. A very useful tutorial that covers health bars, enemies and health packs. If you're new to Flash, I recommend that you learn the basics before trying out this tutorial. REPEAT: This is NOT for beginners.

Anywho, before starting, you should download :icongirlflash:'s Platform Game Engine available for free here: [link]

Again, special thanks to :icongirlflash:, Senocular.com and Kirupa.com. You guys all rock!

Edit:
Fixed some of the problems that caused syntax errors. If you have any further issues, lemme know!
Add a Comment:
 
:iconflashgamecode:
flashgamecode Featured By Owner Jun 28, 2012
Hello, I know our Flash Games Engine maybe can help you: [link]
can like our page on facebook: [link]
thank you
Reply
:iconhanaishi-chan:
hanaishi-chan Featured By Owner Aug 11, 2010  Student General Artist
I love the way you made this tutorial, it's awesome. Really cool :D
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Aug 13, 2010
Thanks ^^
Reply
:iconhanaishi-chan:
hanaishi-chan Featured By Owner Aug 13, 2010  Student General Artist
you're welcome! ^^
Reply
:iconchocogingerfingers:
chocogingerfingers Featured By Owner Jun 15, 2010  Student Filmographer
I put in the actionscript for the enemy for tracker, but it comes up with all these compiler errors.
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Jun 15, 2010
The scripts in this tutorial are written in Actionscript 2. If you're getting compiler errors, it means you're trying to use Actionscript 3, the default script for CS3 and up. The easy fix is to go File>Publish Settings, then navigate to the "Flash" tab and change "Actionscript 3.0" to "Actionscript 2.0". Keep in mind that this will affect any AS3 you are currently using in your project.
Reply
:iconwordweaver1001:
wordweaver1001 Featured By Owner Oct 22, 2012  Student General Artist
I'm having the same problem. I am also using ActionScript 2.0 still with difficulty. Help please?

Great tutorial by the way! :D
Reply
:iconchocogingerfingers:
chocogingerfingers Featured By Owner Jun 15, 2010  Student Filmographer
Yeah I know they're actionscript 2. I put in this script:

onClipEvent(load) {
var speed=1;
}
onClipEvent(enterFrame) {    
var distx = Math.round(_root.spyro._x - this._x);
var disty = Math.round(_root.spyro._y - this._y);
var theta = Math.atan2(disty, distx);

var deltax = ((Math.cos(theta) * speed));
var deltay = ((Math.sin(theta) * speed));
this._x += deltax;
this._y += deltay;
}

Then clicked that box that said check syntax and it said that.. D:
It said for most of them that they must appear within an onClipEvent handler, and an unexpected '}', and a syntax error with 'onClipEvent(enterFrame) { '

Thankyou so much for replying to my message though, I really appreciate it. I've been trying to contact other people that are good at flash, but they never reply.
I'm making my own platform game using tutorials, and I hope I can get it done. My flash game :)
I was looking at your tutorial because I've been having trouble finding the right actionscript to make enemies and health bars.
Reply
:iconbaelavay:
Baelavay Featured By Owner May 13, 2010  Professional General Artist
that link to girlflash's game engine doesn't work atm
Reply
:iconmojoismehkitty:
mojoismehkitty Featured By Owner May 10, 2010
this is awesome! btw if you press the spacebar to get to the MM and you press play again, your character falls through the floor :(
Reply
:iconevolvd-studios:
evolvd-studios Featured By Owner Feb 19, 2010  Hobbyist Traditional Artist
Would you like to Join EvolvdStudios Online? Here you can share all your latest flash animations and games, as well as ask questions and watch our new tutorials that will help you on new animating tricks as well as actionscripting faqs. You can also access our newly created ANIMATED SPRITE DATABASE, Here you can download spritepacks from many famous characters, for example, sonic and mario. These are added weekly, but to enjoy all this, all you have to do is this:
CLIC ON THE CLUB BELOW, FIND THE JOIN NOW BUTTON, PRESS IT, AND VOILA!!! UR IN!
:iconevolvdstudios-online:!!!JOIN NOW!!!:iconevolvdstudios-online:

PS: Had to do a personal invitation scince all our actual invites are now used up >.>
Reply
:iconburgerforlunsh:
BurgerForLunsh Featured By Owner Oct 16, 2009  Student Digital Artist
The instance name for the health bar movie clip is supposed to be "HEALTH," isn't it? You didn't say anything about it, but I think that that's what the "_root.HEALTH" is referring to.
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Oct 16, 2009
You don't need an instance name for that movieClip - as long as the following code shows up in the actions panel when you have the movieClip selected, you're good. '_root.HEALTH' is a variable number, not a movieClip.

onClipEvent (enterFrame) {
this.gotoAndStop(_root.HEALTH);
}
Reply
:iconburgerforlunsh:
BurgerForLunsh Featured By Owner Oct 16, 2009  Student Digital Artist
Ah ok. Thanks
Reply
:iconziggyman:
Ziggyman Featured By Owner May 13, 2009  Professional General Artist
Cool. A really different tutorial.
Reply
:iconvampirepenguin93:
Vampirepenguin93 Featured By Owner May 8, 2009
Wow!
That was really cool!
and helpful! :D
Reply
:iconmumtazzaidi:
Mumtazzaidi Featured By Owner May 8, 2009
Brilliant work friend
Reply
:iconhayliliz:
HayliLiz Featured By Owner Feb 25, 2009
The code (a=1;a<=10;a++){
if (_root.mcPLAYER.mcCOLLIDER.hitTest(_root["mcFAIC"+a]) == true) {
_root.HEALTH -= 2;
}
}

brings up syntax errors whenever I put it into the first frame, do you know why this is?
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Feb 25, 2009
First make sure that the code is under "onEnterFrame = function () {", then delete any extra spaces at the beginning of the line. This is a known issue, and I'm working on fixing it. :)
Reply
:iconhayliliz:
HayliLiz Featured By Owner Feb 26, 2009
I seem to be getting the same problem, I may be doing something else wrong; it has a syntax error with line 6: } as well as "statement block must be terminated by '}'" on the code "onEnterFrame = function () {"... Any ideas how to fix? (Sorry for taking so much of your time)
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Feb 27, 2009
Ok, I think I know what's wrong. Your code shouldn't be even close to line 6, it should be somewhere in the high 20s or 30s.
If you read carefully, you'll see I said to add it in the actions window for the second frame, beneath where it says "onEnterFrame = function () {" < This code is on line 30 for me.
The finished product should look similar to this:
onEnterFrame = function () {
for (a=1; a<=10; a++) {
if(_root.mcPLAYER.mcCOLLIDER.hitTest(_root["mcFAIC"+a]) == true) {
_root.HEALTH -= 2;
}
}
(Lines 30-35 for me)

I really don't mind helping, it's why I created the tutorial in the first place. If you're still having problems, don't hesitate to contact me.
Reply
:iconhayliliz:
HayliLiz Featured By Owner Mar 2, 2009
Sorry, I'm still quite new to all this; only I have around 11 layers but all using the first frame; I don't have a second frame to put the code into, or a code to place it under... This might just be due to the layout of my game but I'm just not entirely sure where it should go.. ^^;
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Mar 2, 2009
Oh, ok I see it now. I was under the impression you were using GirlFlash's template. Anywho, adding a third "}" should fix it. To clarify, the block of code should look like this:
onEnterFrame = function () {
for (a=1; a<=10; a++) {
if (_root.mcPLAYER.mcCOLLIDER.hitTest(_root["mcFAIC"+a]) == true) {
_root.HEALTH -= 2;
}
}
};
Reply
:iconhayliliz:
HayliLiz Featured By Owner Mar 3, 2009
Ah, thankyou; I should have clarified I wasn't using that format ^^;
(One more question? What is the mcCOLLIDER? I've changed the other mc names to my own, but that one confuses me slightly)
THanks for your time and help :)
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Mar 3, 2009
The collider was something I took note of from GirlFlash's template - it's a movie clip inside the player movie clip for each frame on the topmost layer. Since hit test functions only work with rectangular bounding boxes, it's useful to make mcCOLLIDER a rectangle that is the same size as the player. I use it as the destination movie clip for the majority of the player's hit test functions. Alternatively, you can change it to the name of you player movie clip, it'll work the same way, though I find it useful to have a collider instead.
:D
Reply
(1 Reply)
:icontaimysho3:
TaiMySho3 Featured By Owner Feb 23, 2009
I figured out the damage part and now its not having the syntax error but now im having a problem with this code:

onClipEvent (enterFrame) {
 this.gotoAndStop(_root.HEALTH);
}
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Feb 23, 2009
Ah okay, that's good ^^.

The code that you're now having trouble with needs to be pasted in the health bar movie clip actions. If you're still having problems, delete the space in front of the word "this". When I made the tutorial, I didn't realize that indentation can cause errors. This may apply to any code that doesn't work, so try getting rid of all the spaces at the beginning of lines, then autoformat it to test.
Reply
:icontaimysho3:
TaiMySho3 Featured By Owner Feb 24, 2009
yeah, i figured it out. Thanks for the great tutorial
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Feb 25, 2009
You're welcome :)
Reply
:icontaimysho3:
TaiMySho3 Featured By Owner Feb 22, 2009
i keep on getting sytax error on this code:
for (a=1;a<=10;a++){
if (_root.mcPLAYER.mcCOLLIDER.hitTest(_root["mcFAIC"+a]) == true) {
 _root.HEALTH -= 2;
}
}

and does this action go on the heath bar?
onClipEvent (enterFrame) {
 this.gotoAndStop(_root.HEALTH);
}


Other than that everything else works fine and a great tutorial
Reply
:iconhayliliz:
HayliLiz Featured By Owner Feb 25, 2009
You wouldn't be able to clarify how you sorted out the syntax error on the first damage code? I think I'm having the same problem and difficulty sorting it out...
Reply
:icongamesdisk:
gamesdisk Featured By Owner Jan 12, 2009
.. I gliched it... the lady keeps starting in the wall when I press play... she falls to her death
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Jan 13, 2009
Yeah, that'll happen if the player isn't reset on the screen properly... Just press the spacebar and start again - if that doesn't work, refresh the page.
Reply
:iconsophiehoulden:
SophieHoulden Featured By Owner Jan 12, 2009  Professional General Artist
this is really cool by the way, I'm sorry I sprung the announcement of a new version on you whilst you are in development but thats just how things happen I guess ^^;

cant wait to see your finished game :D
Reply
:iconferriswheel42:
ferriswheel42 Featured By Owner Jan 13, 2009
Thanks for the comment ^^ I can't wait to see the finished game either lol :P
Reply
Add a Comment:
 
×
Download SWF download, 293 KB




Details

Submitted on
January 11, 2009
Image Size
293 KB
Resolution
500×450
Link
Thumb
Embed

Stats

Views
7,008
Favourites
140 (who?)
Comments
36
Downloads
300
×