Confira o Videos Épicos #45!
6 Respostas   251 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
class Game_Follower < Game_Character def change_formation if Input.trigger(:C) chase_preceding_character = false end endend
Olá gente, a 3 dias estou estudando Ruby/RGSS3,
vou tentar criar um ABS
class Scene_Map < Scene_Base alias old_update update def update old_update if Input.trigger?(:X) $game_player.followers.visible = !$game_player.followers.visible $game_player.refresh end endend
class Scene_Map < Scene_Base alias old_update update def update old_update if Input.trigger?(:X) for follower in $game_player.followers follower.follow = !follower.follow end end endendclass Game_Follower < Game_Character attr_accessor :follow alias old_initialize initialize def initialize *args old_initialize *args @follow = true end alias old_chase_preceding_character chase_preceding_character def chase_preceding_character old_chase_preceding_character if follow? end def follow? @follow endend
array = [1, 2, 3, 4, 5]a, b, c, d, e = *arrayprint a, b, c, d, e # => 12345print *array # => 12345
def fn *a p aendfn 1, 2, 3, 4, 5 #=> [1, 2, 3, 4, 5]
array = [1,2,3,4,5]p array #=> [1,2,3,4,5]p *array #=> 1 #=> 2 #=> 3 #=> 4 #=> 5
def f1 array p arrayendf1 [1,2,3,4] #=> [1,2,3,4]f1(1, 2, 3, 4, 5, 6) #=> ArgumentErrordef f2 *args p argsendf2([1, 2, 3, 4], 1, 2, '...') #=> [[1, 2, 3, 4], 1, 2, '...']f2(1, 2, 3, 4, 1, 2, '...') #=> [1,2,3,4,1,2,'...']