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.

  1. #===============================================================================
  2. # * Shoot Stuff
  3. #===============================================================================
  4.  
  5. class Game_Event
  6.   attr_accessor :opacity
  7. end
  8.  
  9. class Bullet
  10.   attr_accessor :tile_x
  11.   attr_accessor :tile_y
  12.  
  13.   def initialize(x, y, dir)
  14.     @tile_x = x
  15.     @tile_y = y
  16.     @dir = dir
  17.     @sprite = Sprite.new
  18.     @sprite.bitmap = RPG::Cache.picture('bullet')
  19.    
  20.     real_x = (@tile_x * 32) + 14
  21.     real_y = (@tile_y * 32) + 6
  22.     @sprite.x = real_x
  23.     @sprite.y = real_y
  24.   end
  25.  
  26.   def update
  27.    
  28.     for i in 1..($game_map.events.size)      
  29.       ev_x = $game_map.events[i].x
  30.       ev_y = $game_map.events[i].y
  31.      
  32.       if (ev_x == @tile_x) && (ev_y == @tile_y)
  33.         $game_map.events[i].opacity = 0
  34.       end
  35.     end
  36.    
  37.     case @dir
  38.     when 2  #down
  39.       @sprite.y += 3
  40.     when 4  #left
  41.       @sprite.x -= 3
  42.     when 6  #right
  43.       @sprite.x += 3
  44.     when 8  #up
  45.       @sprite.y -= 3
  46.     end
  47.    
  48.     @tile_x = (@sprite.x - 14) / 32
  49.     @tile_y = (@sprite.y - 6) / 32
  50.    
  51.     @sprite.update
  52.   end
  53.  
  54.   def dispose
  55.     @sprite.dispose
  56.   end
  57. end
  58.  
  59. class Scene_Map
  60.   attr_accessor :bullets
  61.   attr_accessor :bullettime
  62.  
  63.   alias :wy_initialize :initialize
  64.   alias :wy_update :update
  65.  
  66.   def initialize
  67.     @bullets = []
  68.     wy_initialize
  69.     @bullettime = 0
  70.   end
  71.  
  72.   def update
  73.     for i in 0..(@bullets.size - 1)
  74.       @bullets[i].update
  75.     end
  76.     if @bullets.size > 40
  77.       @bullets[0].dispose
  78.       @bullets.delete_at(0)
  79.     end
  80.     @bullettime += 1
  81.     wy_update
  82.   end
  83. end
  84.  
  85. class Game_Player
  86.   attr_accessor :x
  87.   attr_accessor :y
  88. end
  89.  
  90. class Interpreter
  91.   def fire
  92.     if $scene.is_a?(Scene_Map)
  93.       if $scene.bullettime > 5
  94.         player_x = $game_player.x
  95.         player_y = $game_player.y
  96.         dir = $game_player.direction
  97.         $scene.bullets.push(Bullet.new(player_x, player_y, dir))
  98.         $scene.bullettime = 0
  99.       end
  100.     end
  101.   end
  102. end
Expand to see the code.


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.
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
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. wrote:
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 wrote:
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.
Hey, might want to check this out: http://rapidshare.com/files/264471524/a ... eed_xp.zip
Looks like this:
Image
Amy Pond wrote:
R.J. wrote:
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 wrote:
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

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=75457