RPG Maker Forums

I'm trying to make a mini-game for my on-going game but it seems like my script is not really working properly.


Here is what my script looks like : 

module Cache
  def self.cooku(filename)
    load_bitmap("Graphics/Cooku/", filename)
  end
end


class Cooku < Scene_Base
  
  def start
    super()
    cooky_sceney
  end


  def update
    super()
    update_user_movement
    update_salem
  end


  def update_user_movement
    if Input.press?:)LEFT)
      @doomy.x -= @speedy if @doomy.x > 0
    end
    if Input.press?:)RIGHT) 
      @doomy.x += @speedy if @doomy.x < 490
    end
    if (Input.press?:)SHIFT) && Input.press?:)LEFT))
      @doomy.x -= @speedy + 2.5 if @doomy.x > 0
    end
    if (Input.press?:)SHIFT) && Input.press?:)RIGHT))
      @doomy.x += @speedy + 2.5 if @doomy.x < 490
    end  
  end
  
  def update_salem
    if @spawn_timer <= 0
      @enemies << Sprite_Salem.new(@viewport1, @salem_count)
      @salem_count += 1
      @i_spawn_timer -= 1
      @spawn_timer = @i_spawn_timer
    end
    @spawn_timer -= 1
  end
  
  def cooky_sceney
    @speedy = 5
    @spawn_timer = 60
    @i_spawn_timer = 60
    @enemies = []
    @salem_count = 0
    @background = Sprite.new
    @doomy = Sprite.new
    @background.bitmap = Cache.picture("BS")
    @doomy.bitmap = Cache.picture("Doomy")
    @doomy.x = 222
    @doomy.y = 316
    @background.opacity = 0
    @doomy.opacity = 0
    Graphics.wait(15)
    Graphics.fadeout(2)
    @background.opacity = 255
    @doomy.opacity = 255
    Graphics.fadein(2)
    RPG::BGM.new("Airship", 100, 100).play
  end
end


class Sprite_Salem < Sprite
  
  def initialize(viewport, id)
    super(viewport)
    @id = id
    @salem_speedy = 2
    salem_mancare
    init_position
  end
  
  def init_position
    self.x = rand(490)
    self.y = 0
  end
  
  def dispose
    super()
  end
  
  def update
    super()
    update_move
  end
  
  def update_move
    self.y += @salem_speedy
  end
  
  def salem_mancare
    self.bitmap = Cache.cooku("Salem")
  end
end

The problem is the update function in the Sprite_Salem class doesn't seem to work, whatever I would type there.


What's the problem? Am I missing something?

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top