PDA

View Full Version : Top Down Adventure with Melee Frame



S_I
August 12th, 2008, 04:57 AM
First let me introduce myself as not a great programmer, I am an artist that wants to create a fun game that highlights my skills. I have had a flash programming class a year ago and have been working with notes and some tutorials.

I started out with the top down room and the enemy moving in random directions with a trigger at the exit that after a hit test, had the player enter at an x_y coordinate in the next frame. Worked great.

I then created the melee frame and had the player enter that after a collision with the enemy. Once the enemy dies in the melee the player is sent back to the top down frame. Worked OK, except I couldn't remove the enemy from the room so I created another frame with the same background as the top down but without the enemy. The next problem is the exit trigger. It works fine if you don't enter the melee frame but if you enter the melee frame it will just send you to the x_y coordinates of the same frame rather than the next. I made sure the frame number is the correct one.

Is this type of script doable in AS2?
I thought it was going to be a simple script. I have seen similar ideas in games such as DragonFable and Murloc RPG. I intend on just leaving it as a dungeon romp without all the xp and level gaining of the mentioned games. I don't want to make the game-play longer than half an hour.

Thanks if you can help.

S_I

Charleh
August 13th, 2008, 05:12 AM
Anythings doable in AS - check out http://www.hescobastion.com/HDII/gameselector.html - I wrote that and it does plenty! :P

Why couldn't you remove the enemy from the room when they were successfully meleed?

Dark Viper
August 13th, 2008, 10:01 AM
That link doesn't work for me...

Charleh
August 13th, 2008, 01:30 PM
I've updated the link, funny I thought I'd copied the valid link from the site, turns out I'd written it manually... I must have been tired!

S_I
August 13th, 2008, 08:11 PM
Charleh , thanks for taking the time to respond to my thread. That's a sweet game ya got there.

Well, I had a remove movie clip within the brackets to go to the melee frame. This is part of the script that's on the enemy movie clip:

onClipEvent (enterFrame){
if (_root.Cube.hitTest(_root.Player)){
_root.gotoAndPlay(3);
removeMovieClip(this);
}
}
The enemy symbol (Cube) is placed on the screen rather than a duplicate. I tried to make a duplicate but for some reason it wouldn't trigger the frame switch to melee.

Thanks if you can help.

S_I

Charleh
August 14th, 2008, 07:35 AM
Hmm I wouldn't switch frames etc - it can get a bit confusing - the mix of actionscript and timeline action can play havoc with variables etc if you don't keep track of everything.

My whole game is done on two frames - there's the title screen and then the second frame is the game frame. Everything set up using classes and code so there's nothing on the actual screen on my second frame, it's all loaded through classes and procedures - though you may want to put things on your screen.

Why don't you just use removeMovieClip(this); and get rid of the _root frame jump, instead using attachMovie at the start of your game to attach the cube MC to the stage?

S_I
August 17th, 2008, 06:54 PM
Charleh , thanks for helping.
The reason for the _root frame jump is that frame 3 is the melee frame.
I think I'm not explaining well enough what I've been trying to do, so here is a link to a game with a similar idea (though my game had the enemy moving in random directions where as this link has the enemy stagnant}.
http://www.gamerdisclaimer.com/bbs/murloc.php?styleid=2

udin_jelek
August 18th, 2008, 10:37 PM
sorry i can't speak English well, so maybe i really don't understand the problem



originally posted by S_I
The enemy symbol (Cube) is placed on the screen rather than a duplicate. I tried to make a duplicate but for some reason it wouldn't trigger the frame switch to melee.

wouldn't trigger? maybe the duplicate enemy has same instance name with previous enemy instance name.
sorry i can't speak English well (T_T)

why u don't attach you're sample .fla

S_I
August 26th, 2008, 05:48 AM
udin_jelek, sorry it took so long to upload this and thank you for showing interest.
Here is a link to the problem. The graphics are just stand in's till I get the code right.

http://presence-iii.deviantart.com/art/basic-control2bx2Melee2b-96067512