Jump to content
Sign in to follow this  
Chigoo

Display message on game over screen

Recommended Posts

Can you please walk me through modifying it, I just want it to say "Your score is :(Variable goes here)

 

I can do this:

 

  def start
    super
    play_gameover_music
    fadeout_frozen_graphics
    msgbox_p("Your score is: #{$game_variables[2]}")
    create_background
  end
 
in the game over scene but I don't actually know how to make an In-game message box, or draw text... 
Edited by Chigoo

Share this post


Link to post
Share on other sites

A quick example of what you could do:

class Scene_Gameover < Scene_Base

alias galv_chigoo_gotext_start start

def start

galv_chigoo_gotext_start

create_txt_window

end

 

def create_txt_window

@txt_window = GoText_Window.new

end

end

 

class GoText_Window < Window_Base

def initialize

super(0, 0, Graphics.width, fitting_height(1))

draw_message

end

 

def draw_message

txt = "Your score is " + $game_variables[1].to_s

draw_text(0,0, Graphics.width, line_height, txt,1)

end

end

Share this post


Link to post
Share on other sites

 

A quick example of what you could do:

class Scene_Gameover < Scene_Base
  alias galv_chigoo_gotext_start start
  def start
    galv_chigoo_gotext_start
    create_txt_window
  end
  
  def create_txt_window
    @txt_window = GoText_Window.new
  end
end

class GoText_Window < Window_Base
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    draw_message
  end

  def draw_message
    txt = "Your score is " + $game_variables[1].to_s
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
end

 

Wow thanks, that seems to do the trick.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×