Hi guys I was woundering when you do a module.....
exemple you call a configuration like a font comparaison
you will call like this :
def draw_text_title @text = Sprite.new @text.z = 100 @text.bitmap = Bitmap.new(Graphics.width, Graphics.height) @text.bitmap.font.size = TITLE[:size] @text.bitmap.font.name = TITLE[:font] @text.bitmap.font.italic = TITLE[:italic] @text.bitmap.font.bold = TITLE[:bold] @text.bitmap.font.outline = TITLE[
utline] @text.x = TITLE[:x] @text.y = TITLE[:y] rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2) @text.bitmap.draw_text(rect, $data_system.game_title, 1) endthis seem alright ...but if you take the TITLE module calling....if you call to much longer on the same line this will become a little unreadable no?
like this exemple
@title.amp = (Exemple[:wave],Exemple[:amplitude],Exemple[:speed])do you think this not a little big? I mean ....this not better to all stuck this kind of module call like this?
def getting_module_information # System module information @file = SYSTEM[:bgm_name] @volume = SYSTEM[:bgm_volume] @pitch = SYSTEM[:bgm_pitch] # gameover logo module information @font_name = "" @font_size = "" end so in simple all the module information will be store in variable and in the SAME method.
the result in script!
def play_gameover_music # storing module information RPG::BGS.stop case SYSTEM[:me_or_bgm] when "BGM","bgm" return RPG::BGM.new(@file,@volume,@pitch).play when "ME","me" RPG::BGM.stop return $data_system.gameover_me.play end end Why ? simply this remove the fact you have to run all the script for know what configuration run what !
but this simply my opinion and please do not critique how I call my stuff (exemple SYSTEM[:ect]) this how luna engine do and I love this way because this clean and work great!
I just want to know what you think of the module method and how you do your own way !
on this thanks for reading!
exemple you call a configuration like a font comparaison
you will call like this :
def draw_text_title @text = Sprite.new @text.z = 100 @text.bitmap = Bitmap.new(Graphics.width, Graphics.height) @text.bitmap.font.size = TITLE[:size] @text.bitmap.font.name = TITLE[:font] @text.bitmap.font.italic = TITLE[:italic] @text.bitmap.font.bold = TITLE[:bold] @text.bitmap.font.outline = TITLE[
like this exemple
@title.amp = (Exemple[:wave],Exemple[:amplitude],Exemple[:speed])do you think this not a little big? I mean ....this not better to all stuck this kind of module call like this?
def getting_module_information # System module information @file = SYSTEM[:bgm_name] @volume = SYSTEM[:bgm_volume] @pitch = SYSTEM[:bgm_pitch] # gameover logo module information @font_name = "" @font_size = "" end so in simple all the module information will be store in variable and in the SAME method.
the result in script!
def play_gameover_music # storing module information RPG::BGS.stop case SYSTEM[:me_or_bgm] when "BGM","bgm" return RPG::BGM.new(@file,@volume,@pitch).play when "ME","me" RPG::BGM.stop return $data_system.gameover_me.play end end Why ? simply this remove the fact you have to run all the script for know what configuration run what !
but this simply my opinion and please do not critique how I call my stuff (exemple SYSTEM[:ect]) this how luna engine do and I love this way because this clean and work great!
I just want to know what you think of the module method and how you do your own way !
on this thanks for reading!
Last edited by a moderator:
