Flash submissions are emulated via Ruffle. Ruffle is currently in development and compatibility is not guaranteed. Click here for more info.
Learning Flash: First Person Shooter
Continuing to learn Flash, this time around it's Action Script 3 via Object Oriented Programming.
This game is played entirely with the mouse.
You can shoot the enemy bullets.
Fully charged bar does double damage.
Cobbled the code together using a tutorial in about 2-3 days.
The format is based loosely off "Battle Clash" for the SNES, and this was more or less a sort of initial test at assembling a base game engine.
Unfortunately it's riddled with bugs due to my inept programming skills.
Ignore the keyboard button (and the score) they are just bits and pieces left from the base code from the tutorial, and mostly serve as reference for me to remind myself how some of the code works.
In any case the major bug with this game is when you 'restart' it. The code from the previous instance of the game for whatever reason keeps running despite the reset. Most of it is hidden via me killing sound effects when the enemy is about to die, if not for that once you killed the enemy there's a decent chance the sound will loop forever.
Ideally if I can construct a bug free (or relatively bug free) engine, then I'll be constructing more complex enemies to battle against.
This game is played entirely with the mouse.
You can shoot the enemy bullets.
Fully charged bar does double damage.
Cobbled the code together using a tutorial in about 2-3 days.
The format is based loosely off "Battle Clash" for the SNES, and this was more or less a sort of initial test at assembling a base game engine.
Unfortunately it's riddled with bugs due to my inept programming skills.
Ignore the keyboard button (and the score) they are just bits and pieces left from the base code from the tutorial, and mostly serve as reference for me to remind myself how some of the code works.
In any case the major bug with this game is when you 'restart' it. The code from the previous instance of the game for whatever reason keeps running despite the reset. Most of it is hidden via me killing sound effects when the enemy is about to die, if not for that once you killed the enemy there's a decent chance the sound will loop forever.
Ideally if I can construct a bug free (or relatively bug free) engine, then I'll be constructing more complex enemies to battle against.
Category Flash / Miscellaneous
Species Unspecified / Any
Size 640 x 360px
File Size 246.9 kB
Once you've get the hang of it. There is no stopping you, considering using back 1 code for many stages! Make it dynamic! Stages file are not code dependent, and you will do a lengthy game. I've done a game in the past too, it was called the elevator action (based on Konami's Elevato Action). The engine was a killer to do it in AS2. Still, the game has made a hit in my flash class!
I've just picked up AS3 about a month or 2 ago, only to learnt that it was a much more stable and versatile. Keep on going with you effort and you will hit the gold mine!
I've just picked up AS3 about a month or 2 ago, only to learnt that it was a much more stable and versatile. Keep on going with you effort and you will hit the gold mine!
The plan is to basically recreate http://www.youtube.com/watch?v=IGoFqMyFaZI but using my own creations.
From your talk of instances, it sounds like your game is a flash movie inside of a flash movie? I assume that's why you can have multiple instances of the game running at ones?
Your game is awesome on a touch screen. But, on a track pad it's kind of hard to play. It would be easier if it played more like a time crisis game. ( Space to doge, click to fire. )
Your game is awesome on a touch screen. But, on a track pad it's kind of hard to play. It would be easier if it played more like a time crisis game. ( Space to doge, click to fire. )
Oh the score thing? I could add one in pretty easily. It originally counted up every time an enemy appeared, I could have easily converted it to display a combination of health remaining + damage done to the enemy; but that's just a minor detail I wasn't concerned with implementing with such a shoddy coding used.
The problem I'm seeing is the instant death when restarting. It seems to me that the script that was supposed to halt the operation when the game is over seems to continue going over on top of what the game is being played on. If anything, this is rather still impressive work!
ActionScript has killer problems with garbage collection. If you're using OOP, and you have any class that you instantiate with any reference to the stage, any Event.EnterFrame event handlers (I think that's the event, something with opening up a frame), any timers in that class, and any loaders, you have to forcibly stop them in a function that's called when you want them destroyed. This means you need to be sure to remove any event handlers that involve the stage, any eventhandlers that come with your EnterFrame event, any timers, and any loaders. I really recommend to help keep track of these that you create a Setup method in anything that uses these, then a special destroy function for when you want to clear your stage. Loaders you have to be sure to unloadAndStop() (only works with Flash 10 and higher, I think), and set the loader variable to null to really clear everything out.
Otherwise the Flash application will perpetually run in browser. This is a major source of memory leaks and security bugs in ActionScript. I ran into this problem when I was creating a museum application that loaded 6 different "levels" depending on where someone was at, and not having this careful setup and teardown in place for each one created a huge memory leak. This program had to run for 8 hours at a time, so it had to be fixed. I would also advise you to put up a warning that people may need to close their browsers after playing this to completely clear it from memory.
Otherwise the Flash application will perpetually run in browser. This is a major source of memory leaks and security bugs in ActionScript. I ran into this problem when I was creating a museum application that loaded 6 different "levels" depending on where someone was at, and not having this careful setup and teardown in place for each one created a huge memory leak. This program had to run for 8 hours at a time, so it had to be fixed. I would also advise you to put up a warning that people may need to close their browsers after playing this to completely clear it from memory.
Come to think of it, the other thing you might look for is if the children of the game engine class have any of the same devices (stage references, timers, enterFrame events, loaders) as well, or references to the game engine's class's stage. You have to be very, very careful about cleaning up with Actionscript. I'd recommend the next time you put something together in AS, keep these things in mind, and whenever you set one of these things down, right after you do it, set up in a clearStage function to clear the new piece out when it's time to close.
This is good, now make a platforming shooter
It's actually not that hard, you have to give character arms their own coordinates to looking at the mouse.
Use my game for example,
http://www.mediafire.com/?h13mmnqrqdy
Please excuse the ear melting out of place music, for I was in highschool therefor had absolutely no taste.
It's actually not that hard, you have to give character arms their own coordinates to looking at the mouse.
Use my game for example,
http://www.mediafire.com/?h13mmnqrqdy
Please excuse the ear melting out of place music, for I was in highschool therefor had absolutely no taste.
hmm, I felt that this was very fast. You mention full bar doing extra damage, but it's impossible to full without taking a bunch of hits, and then its VERY likely you will miss because of the speed of the enemy. I felt that the bullets moved towards you too fast as well, because by the time i get to shooting at them, I have one or two shots and I miss the first one, usually, because I'm trying to hit it quickly and get some more shots in on the enemy... which miss because the travel time means you have to aim ahead of the enemy, and he's constantly zigzagging around quite fast. This makes it difficult to aim right.
^ Are some points I think you should look into for your next practice game.
I think the animation and movement of the game is very nice and steady, and all the mechanics while playing work fine. I also much appreciate the start button/screen on this game vs the space shooter one :)
Can't wait to see what you come up with next :)
^ Are some points I think you should look into for your next practice game.
I think the animation and movement of the game is very nice and steady, and all the mechanics while playing work fine. I also much appreciate the start button/screen on this game vs the space shooter one :)
Can't wait to see what you come up with next :)
The way the enemy was designed was done in the span about 5-10 minutes. If I was to work on it more, I would make it so that the enemy would fire off a series of shots, then a 'dead' zone in where it wouldn't shoot at all to give you a chance to get a fully charged bar without repercussions XD
I have little intention of refining the little nuances until I create a more bug-free engine to work with. Though once I do, then I'll be free to be a lot more creative and thoughtful; otherwise it would be mostly wasted effort.
I have little intention of refining the little nuances until I create a more bug-free engine to work with. Though once I do, then I'll be free to be a lot more creative and thoughtful; otherwise it would be mostly wasted effort.
FA+

Comments