Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Making a shooter

For lack of a better place to post this I'm plonking it here.

I felt like opening RPG Maker again, mainly after playing Deus Ex and thinking "oh hey you could sortof do that with RPG Maker? lol" but yeah.

So I started trying to make the mechanics for a shooting game.

This is what I have so far:

- pressing A fires a bullet from the player's location which moves in the direction the player is facing indefinately
- if there are more than 40 bullets they start disappearing from 0
- if the bullet hits an event, that event disappears

Very basic stuff so far.

Code:
#===============================================================================

# * Shoot Stuff

#===============================================================================

 

class Game_Event

  attr_accessor :opacity

end

 

class Bullet

  attr_accessor :tile_x

  attr_accessor :tile_y

  

  def initialize(x, y, dir)

    @tile_x = x

    @tile_y = y

    @dir = dir

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.picture('bullet')

    

    real_x = (@tile_x * 32) + 14

    real_y = (@tile_y * 32) + 6

    @sprite.x = real_x

    @sprite.y = real_y

  end

  

  def update

    

    for i in 1..($game_map.events.size)      

      ev_x = $game_map.events[i].x

      ev_y = $game_map.events[i].y

      

      if (ev_x == @tile_x) && (ev_y == @tile_y)

        $game_map.events[i].opacity = 0

      end

    end

    

    case @dir

    when 2  #down

      @sprite.y += 3

    when 4  #left

      @sprite.x -= 3

    when 6  #right

      @sprite.x += 3

    when 8  #up

      @sprite.y -= 3

    end

    

    @tile_x = (@sprite.x - 14) / 32

    @tile_y = (@sprite.y - 6) / 32

    

    @sprite.update

  end

  

  def dispose

    @sprite.dispose

  end

end

 

class Scene_Map

  attr_accessor :bullets

  attr_accessor :bullettime

  

  alias :wy_initialize :initialize

  alias :wy_update :update

  

  def initialize

    @bullets = []

    wy_initialize

    @bullettime = 0

  end

  

  def update

    for i in 0..(@bullets.size - 1)

      @bullets[i].update

    end

    if @bullets.size > 40

      @bullets[0].dispose

      @bullets.delete_at(0)

    end

    @bullettime += 1

    wy_update

  end

end

 

class Game_Player

  attr_accessor :x

  attr_accessor :y

end

 

class Interpreter

  def fire

    if $scene.is_a?(Scene_Map)

      if $scene.bullettime > 5

        player_x = $game_player.x

        player_y = $game_player.y

        dir = $game_player.direction

        $scene.bullets.push(Bullet.new(player_x, player_y, dir))

        $scene.bullettime = 0

      end

    end

  end

end

Events:

Parallel process:

@> Conditional Branch: The X button is being pressed
@> Script: fire
@>
: Else
@>
: Branch End
@>


And then any enemies you want walking around the map.

Anyway, comments/suggestions/requests? I am thinking of making a simple game with this.
 

regi

Sponsor

Well for one, the parallel process event is completely unnecessary; just use a check for Input.press?(INPUT::X) under def update.

For another, I don't see why bullets should disappear only after 40. Why not make them vanish once they hit the end of the screen?

I'm not entirely sure what you're looking for here. There really isn't much to discuss; perhaps you could ask for ideas regarding a concept in Concept Dev? Because with so many shooters out there, all but the most creative ones will get overlooked. Once you have your mechanisms and game design sketched out, you might want to flesh out cool unique gimmicks to set your game apart from others.
 
Ok here's what I've got so far:

Enemies

If they're within 5 tiles of you in both directions, they will move towards you. Otherwise they run on the following pattern:

Turn left or right
Move forwards until you hit a wall
Repeat

When hit by a bullet they are replaced with a down sprite and a blood splatter moves in the direction of the bullet across the floor.

If you press enter you can drag an enemy out of the way (as you can't walk through them).

Bullets

Dispose on the edge of the screen rather than at 40.



This is a concept mostly. I've never tried making a shooter so wanted to have a go at the mechanics behind one and also at trying to make some unique things alongside.



Planned improvement:

Enemy Shooting

If enemy is within 5 tiles in both directions, move towards the player. (done)

If enemy is within 2 tiles in both directions, turn towards the player, stand still and shoot.
 
If you're really interested in doing a shooter, would you like to ditch RPG maker and help me out with a ray-caster FPS?
I was inspired after playing the new Deus Ex also
 

R.J.

Member

Well it's a nice effort, you don't see that many RPG Maker shooters. But still what's been laid out here is quite basic. What puts this apart from the other shooters made in RPG Maker?
 
R.J.":245of9ae said:
Well it's a nice effort, you don't see that many RPG Maker shooters. But still what's been laid out here is quite basic. What puts this apart from the other shooters made in RPG Maker?

Really, not much. I'm making this just to make something rather as something people would want to play.

Xilef":245of9ae said:
If you're really interested in doing a shooter, would you like to ditch RPG maker and help me out with a ray-caster FPS?
I was inspired after playing the new Deus Ex also

Oh, I don't really have the time to go into a big project. If I was to work long and hard on something it would be Afar; this shooter is just a little thing I wanted to try because I'd never done it before. I doubt I'll pull through with it until the end but I'll post a demo when I've finished some cool stuff.


What I'm aiming to build here, rather than a game, is a sort of room with lots of things you can do as a showcase of the stuff I'm making for it. I'm on a Games Programming course so it would be helpful towards building a portfolio.
 

R.J.

Member

Amy Pond":qnnk12jg said:
R.J.":qnnk12jg said:
Well it's a nice effort, you don't see that many RPG Maker shooters. But still what's been laid out here is quite basic. What puts this apart from the other shooters made in RPG Maker?

Really, not much. I'm making this just to make something rather as something people would want to play.

Xilef":qnnk12jg said:
If you're really interested in doing a shooter, would you like to ditch RPG maker and help me out with a ray-caster FPS?
I was inspired after playing the new Deus Ex also

Oh, I don't really have the time to go into a big project. If I was to work long and hard on something it would be Afar; this shooter is just a little thing I wanted to try because I'd never done it before. I doubt I'll pull through with it until the end but I'll post a demo when I've finished some cool stuff.


What I'm aiming to build here, rather than a game, is a sort of room with lots of things you can do as a showcase of the stuff I'm making for it. I'm on a Games Programming course so it would be helpful towards building a portfolio.

Alright, cool. Well it sort of reminded me of Pokemon: The Evil Inside, one of the few RPG Maker shooters
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top