RPG Maker Forums

Hello community. The problem I am experiencing so far is as the title says: when the code below runs, after a while the game closes.
I get no error message and the code works perfectly until it closes...and when it closes I get no error messages at all, it just closes the game as if I had pressed Alt+F4.

Code:
class Window_Exercise < Window_Base
  def initialize(exercise_window, x, y, width, height, numbers, plusminus)
    super(x, y, width, height)
    @numbers = numbers
    @plusminus = plusminus
    @exercise_window = exercise_window
    refresh
  end
  
  def draw_images
    pic = Array.new
    src = Array.new
    ret = Array.new
    for i in 0..1
      pic << Bitmap.new(@numbers[i].image)
      src << Rect.new(0,0,pic[i].width,pic[i].height)
      ret << Rect.new(174*i,0,pic[i].width,pic[i].height)
      self.contents.stretch_blt(ret[i],pic[i],src[i])
    end
#-------------------------------------------------------------------------------
    i+=1
    pic << Bitmap.new(@result_num.image)
    src << Rect.new(0,0,pic[i].width,pic[i].height)
    ret << Rect.new(174*i,0,pic[i].width,pic[i].height)
    self.contents.stretch_blt(ret[i],pic[i],src[i])
#-------------------------------------------------------------------------------
    i+=1
    pic << Bitmap.new("Graphics/Pictures/#{@plusminus}")
    src << Rect.new(0,0,pic[i].width,pic[i].height)
    ret << Rect.new(116,0,pic[i].width,pic[i].height)
    self.contents.stretch_blt(ret[i],pic[i],src[i])
    i+=1
    pic << Bitmap.new("Graphics/Pictures/=")
    src << Rect.new(0,0,pic[i].width,pic[i].height)
    ret << Rect.new(280,0,pic[i].width,pic[i].height)
    self.contents.stretch_blt(ret[i],pic[i],src[i])
  end
  
  def update
    super
    refresh
  end
  
  def refresh
    contents.clear
    @result_num = @exercise_window.item
    draw_images
  end
end

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,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top