3D Sidescroller RunNGun

I decided to create a 3D side scrolling run and gun for mobile

This is inspired by Contra, Megaman, Metal Slugs. It is not a true 3D, just a classic 2d run’gun mechanic with 3D models. Story would be like “escape from new York/ LA” type but more disgusting creatures emerges as you get to later stages. (At least 5 stages are planned but let’s see if there could be more)

This is what I have done so far.

Features

Player:

WASD control with 8 ways diagonal aim, jump, shoot, weapon switch.

Enemies:
Running ground enemy
-Just run at you
-appears constantly when in the right zone
-only 3 on screen at a time

8 ways shooting turret
-aim at player, limit to 8 directions.

Moving Platforms:
Each done in different ways using codes, Path3D, animation, and tween. All are working as intended.

Extras
Coins popping when certain enemies are killed

still need to make coins disappears after few seconds.
need to fix coins doubling if killed with 2 or more bullets at the same time.

To do list:
-Scoring, Health bar, other UI elements.
-Player actions (Crouching, platform drop down, Ledge grab, and Rope Hanging)
-More weapons (laser, missile, flame thrower)
-More types of enemy (Flying, grenade throwing, tanks, bosses)

4 Likes

Update player’s interaction and collapse platform

5 Likes

Done some player weapons: Normal, Spread, Flame, Laser, and Heatseeking missile.

Next up will do some variations of enemy weapons.

Then will be putting the first level together and start player modelling/animations.

1 Like

Been testing a few different enemy types and shootings.

Ground enemy type:

  • Run and jump attack
  • Straight shooter
  • Throwing attack
  • Left/Right patrol
  • Crawling
  • Bouncing

Fly type:

  • Up/Down sine pattern
  • Tween pattern
  • Wander and chase player if close enough

Turret type:

  • 8 ways aim shooter
  • Limited angle shooter
  • Burst shooter
  • Spin shooter
  • Curve sine bullet shooter
  • Bullet hell style shooter

Next will finally start on visuals. Time to fire up my blender program.

1 Like

Little update on animation tree blending using placeholder model from makehuman software and a quick rig for testing.

Can’t decide if I should flip the model (so he looks the same on both side) or keep it natural as is (see his back when turning left)

I put visual/animation on hold and went back to update my player control. New features are:

  • Now with Enum/Match statemachine
  • Climb ladder with shooting directions
  • Ledge grab with shooting directions
  • Rail hang with shooting directions

Took me awhile to figure all the logics out. I had to separate the body, the aiming, and the raycasts detection into individual function group so I can update them in each state.

I think I pretty much got what I wanted to work. Will continue on with visuals/animations next.

Quick update:

Add another version of player control to work with keyboard and mouse

  • A/D = Left/Right
  • W/S = Climb Ladder Up/Down/Crouching
  • LMB = Shoot
  • Aiming is now done with mouse.
  • Still not yet decide which button to jump (Either press W or Spacebar or RMB). I will add animations and some enemies to playtest it first to see how it feels.

Will truly start modelling and animation now finally

1 Like

eyyy dude that looks really awsome !!!

do you have a discord i can contact you with ?

Sorry no discord. All the mechanics I got are from online tutorials/forum questions. So if you have any specific question then I could point you to the tutorial for it.

Update: Aiming

Took awhile because in the beginning I had a player with 360 rotation aiming so I’ve been playing around with arm bone rotations. Suddenly I thought that wouldn’t be fair for the enemies because they can only shoot in 8 directions! so I went back with 8 directions shooting for player and use animation player/tree instead (and much easier than bone rotations).

  • Player shoots in 8 directions
  • Aim by mouse, move by keyboard.
  • Testing aiming animations using animationPlayer only, no blending just yet.
  • The red thing is a placeholder for gun. Right now it is boneattachment to forearm so it looks a bit weird, will correct the placement later.

can you share how to implement this mechanics i want to add the same in my game

I have a characterBody3d with the actual model body, the aiming, and the raycasts into its own child node group.

-CharacterBody3D
–Model body node
–Aim node group
–Raycast detection node group

  • CharacterBody3D for general movements.
  • The model body is for model animation and code to flip the model left/right.
  • The aim node includes that Big yellow arrow mesh that rotates from player position. I learn the aiming 8 directions from here:

https://godotforums.org/d/40642-gun-turret-aim-at-player-with-only-8-rotating-directions

The aiming needs a target so I use mouse position in 3d as the target (using Plane forward- facing instead of down-facing of this tutorial)

the Aim node group also has a marker3D which I shoot the bullet out of.

  • The raycasts node group is also just for flipping left/right.
1 Like

Update: Boss area camera movements & Changed Player’s camera to orthogonal

*I sped up player movements for quick showing.

  • Using subviewport, I’ve separated my player’s camera to orthogonal while keeping level’s camera to perspective. This way you can see the player on fixed view angle all the time instead of level’s perspective camera angle, which aims slightly looking down on top of player’s head.

using just level’s perspective camera angle
Imgur

Now with Player’s orthogonal camera angle
Imgur

  • I also did a sub-boss/boss camera area, where it ‘detach’ from player and move to a fixed position when fighting with bosses. Nothing fancy, when player touches an invisible area3D it turn “camera to follow player” bool = false then lerp camera to desired position.