00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Need help on an arcade FPS-like Flash game

613 Views | 6 Replies
New Topic Respond to this Topic

I'm using AS 2.0 btw.


So, I'm trying to do a simple FPS Flash game inspired by shooting arcades with nostalgic Flash artsyle for this year's Flash Forward, succeeded in doing the background-following thingy, the gun, of course, the animation whenever shooting, but here's the catch: before some tweaking, the gun was shooting automatically and would stop forever when pressing the left mouse button; then, I managed to make it shoot when clicked, only problem was that when i pressed the button, it would shoot automatically without stoping in any way.


Did my best trying to make it shoot semi-automatically, but to no avail as of now.


Here's the FLA if you want to take a closer look:

https://www.newgrounds.com/dump/item/7597e5598b92ca2077ad2f5dd78b4b8d


If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here. I'll accept info 'till the jam's deadline, so hurry and help a homie out, plox! :(


In nights I try myself to soot, But the memories and traumas pierce; my chest and head like a spear so fierce; hits so hard in my soul, down to the root.

BBS Signature

Try this: (requires flash cs5+)


https://www.newgrounds.com/dump/item/8f16372bb2a9681b81026e0a3ad2ba12


There was a typo: it's _root.gun1_shooter in one function and _root.gun1shooter in another. Changed it to the correct variable name (gun1_shooter) and it sort of worked, but not quite (since the gun animation would stop playing the moment you let go of the mouse)


Changed some other things around to fix that - moved the gun animation outside and added a script to let it fire only when the mouse is held down and it's at frame 1; if the mouse is not held down, then it plays its animation fully and then stops instead of looping (so that it doesn't fire and stop halfway through if the player clicks it just once).


At 3/3/23 03:05 PM, TheAsterDood02 wrote: If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here.

Try implementing them yourself first and ask if/when you run into any issues - because as it stands, writing how to do all the above is tantamount to just having someone else make the game for you.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Need help on an arcade FPS-like Flash game 2023-03-04 04:39:00


At 3/4/23 01:31 AM, Gimmick wrote: Try this: (requires flash cs5+)

https://www.newgrounds.com/dump/item/8f16372bb2a9681b81026e0a3ad2ba12

There was a typo: it's _root.gun1_shooter in one function and _root.gun1shooter in another. Changed it to the correct variable name (gun1_shooter) and it sort of worked, but not quite (since the gun animation would stop playing the moment you let go of the mouse)

Changed some other things around to fix that - moved the gun animation outside and added a script to let it fire only when the mouse is held down and it's at frame 1; if the mouse is not held down, then it plays its animation fully and then stops instead of looping (so that it doesn't fire and stop halfway through if the player clicks it just once).

At 3/3/23 03:05 PM, TheAsterDood02 wrote: If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here.
Try implementing them yourself first and ask if/when you run into any issues - because as it stands, writing how to do all the above is tantamount to just having someone else make the game for you.


Ayo thank you sou much, man! You saved my bacon and braincells from a total burnout. The rest of the mentioned features I'll implement with the tutorial series I based the game on, plus with a tutorial vid on how to make the main menu.

I'll be sure to seek for your help when I might be in a softlock, but for now I say again, thx a lots, man! :)


In nights I try myself to soot, But the memories and traumas pierce; my chest and head like a spear so fierce; hits so hard in my soul, down to the root.

BBS Signature

At 3/4/23 01:31 AM, Gimmick wrote: Try this: (requires flash cs5+)

https://www.newgrounds.com/dump/item/8f16372bb2a9681b81026e0a3ad2ba12

There was a typo: it's _root.gun1_shooter in one function and _root.gun1shooter in another. Changed it to the correct variable name (gun1_shooter) and it sort of worked, but not quite (since the gun animation would stop playing the moment you let go of the mouse)

Changed some other things around to fix that - moved the gun animation outside and added a script to let it fire only when the mouse is held down and it's at frame 1; if the mouse is not held down, then it plays its animation fully and then stops instead of looping (so that it doesn't fire and stop halfway through if the player clicks it just once).

At 3/3/23 03:05 PM, TheAsterDood02 wrote: If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here.
Try implementing them yourself first and ask if/when you run into any issues - because as it stands, writing how to do all the above is tantamount to just having someone else make the game for you.


Ok, so I added a cool main menu to it and also put some enemy concepts that I want to turn into shootable targets. I tried to make them still behind cover so they pop up out to be shootable, but they just get stuck on the background, following still in the air as I aim around. Plus as much as i try to edit the enemy's hit symbol it edits the normal head too.


Ended up deleting the layer cuz it was frustrating me a bit, so any help would be good.


Updated link: https://www.newgrounds.com/dump/item/780c5f483568a7860e33bdcf34d1aef9


I'll answer in this post tomorrow, it's night-time here, don't worry if I don't answer today, sry. ^^;


In nights I try myself to soot, But the memories and traumas pierce; my chest and head like a spear so fierce; hits so hard in my soul, down to the root.

BBS Signature

Response to Need help on an arcade FPS-like Flash game 2023-03-05 23:35:20


At 3/4/23 05:59 PM, TheAsterDood02 wrote:
At 3/4/23 01:31 AM, Gimmick wrote: Try this: (requires flash cs5+)

https://www.newgrounds.com/dump/item/8f16372bb2a9681b81026e0a3ad2ba12

There was a typo: it's _root.gun1_shooter in one function and _root.gun1shooter in another. Changed it to the correct variable name (gun1_shooter) and it sort of worked, but not quite (since the gun animation would stop playing the moment you let go of the mouse)

Changed some other things around to fix that - moved the gun animation outside and added a script to let it fire only when the mouse is held down and it's at frame 1; if the mouse is not held down, then it plays its animation fully and then stops instead of looping (so that it doesn't fire and stop halfway through if the player clicks it just once).

At 3/3/23 03:05 PM, TheAsterDood02 wrote: If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here.
Try implementing them yourself first and ask if/when you run into any issues - because as it stands, writing how to do all the above is tantamount to just having someone else make the game for you.
Ok, so I added a cool main menu to it and also put some enemy concepts that I want to turn into shootable targets. I tried to make them still behind cover so they pop up out to be shootable, but they just get stuck on the background, following still in the air as I aim around. Plus as much as i try to edit the enemy's hit symbol it edits the normal head too.

That's because they need to be programmed to move just like the background - their position should be based on the mouse coordinates. One way of handling this is to put everything that's not the gun (background, enemies, etc) into a movieclip and have that move based on the mouse coordinates; another way is to use a VCam, and move only the VCam around while keeping everything else stationary.


As for the hit symbol, you'll have to check if the crosshairs hit the enemy's head while the gun is firing. You can add the following code to the head movieclip (of the enemy) for this:

onClipEvent(enterFrame) {
    if(_root.crossh_gun1.hitTest(this) && _root.firing) {
        //hit
    }
}

_root.firing here would have to be set to "true" whenever the gun is firing and "false" whenever it's not; you can do this in the gun's timeline.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Need help on an arcade FPS-like Flash game 2023-03-06 16:49:04


At 3/5/23 11:35 PM, Gimmick wrote:
At 3/4/23 05:59 PM, TheAsterDood02 wrote:
At 3/4/23 01:31 AM, Gimmick wrote: Try this: (requires flash cs5+)

https://www.newgrounds.com/dump/item/8f16372bb2a9681b81026e0a3ad2ba12

There was a typo: it's _root.gun1_shooter in one function and _root.gun1shooter in another. Changed it to the correct variable name (gun1_shooter) and it sort of worked, but not quite (since the gun animation would stop playing the moment you let go of the mouse)

Changed some other things around to fix that - moved the gun animation outside and added a script to let it fire only when the mouse is held down and it's at frame 1; if the mouse is not held down, then it plays its animation fully and then stops instead of looping (so that it doesn't fire and stop halfway through if the player clicks it just once).

At 3/3/23 03:05 PM, TheAsterDood02 wrote: If you have any coding info on how to fix and point out some things, add a limited ammo and score counter, make a simple main menu, game over screen, success screen, add enemies and all that stuff, please feel free to tell me here.
Try implementing them yourself first and ask if/when you run into any issues - because as it stands, writing how to do all the above is tantamount to just having someone else make the game for you.
Ok, so I added a cool main menu to it and also put some enemy concepts that I want to turn into shootable targets. I tried to make them still behind cover so they pop up out to be shootable, but they just get stuck on the background, following still in the air as I aim around. Plus as much as i try to edit the enemy's hit symbol it edits the normal head too.
That's because they need to be programmed to move just like the background - their position should be based on the mouse coordinates. One way of handling this is to put everything that's not the gun (background, enemies, etc) into a movieclip and have that move based on the mouse coordinates; another way is to use a VCam, and move only the VCam around while keeping everything else stationary.

As for the hit symbol, you'll have to check if the crosshairs hit the enemy's head while the gun is firing. You can add the following code to the head movieclip (of the enemy) for this:
_root.firing here would have to be set to "true" whenever the gun is firing and "false" whenever it's not; you can do this in the gun's timeline.


Thanks for all the help for now. I'm not a good programer, hence the so much asking for help (sry for it btw), so I decided to postpone the game's release to another date other than the Flash Forward deadline cuz of logistics and work flow. I'll be working on an animation 'till then, but atleast I learned how to make a start menu for the anim, plus some other programming goodies, so that's that!


If you ever want to help me program the game once the animation's done, feel free to PM me whenever you have time. But I say again, thanks for helping a homie out anyways! Love the edgy comradery that Newgrounds has in it's wholesome soul. :)


In nights I try myself to soot, But the memories and traumas pierce; my chest and head like a spear so fierce; hits so hard in my soul, down to the root.

BBS Signature

At 3/6/23 04:49 PM, TheAsterDood02 wrote:
At 3/5/23 11:35 PM, Gimmick wrote: As for the hit symbol, you'll have to check if the crosshairs hit the enemy's head while the gun is firing. You can add the following code to the head movieclip (of the enemy) for this:
_root.firing here would have to be set to "true" whenever the gun is firing and "false" whenever it's not; you can do this in the gun's timeline.
Thanks for all the help for now. I'm not a good programer, hence the so much asking for help (sry for it btw),

Don't be! Feel free to ask for help whenever, as long as you've shown you've made some effort (e.g. mentioning what you've done/doesn't work/etc.) then there's absolutely no issue at all since that's the best way to learn.

think so I decided to postpone the game's release to another date other than the Flash Forward deadline cuz of logistics and work flow.

Deadlines come by quick even when they're extended - I had to do the same for my submissions a couple years ago because of other commitments + the scope of the game being too great to release on time. Still, there's always next year, or even any upcoming events this year.

If you ever want to help me program the game once the animation's done, feel free to PM me whenever you have time. But I say again, thanks for helping a homie out anyways! Love the edgy comradery that Newgrounds has in it's wholesome soul. :)

Sure, and no problem!


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature