Sobeman459
Member
Okay so i have this data class:
and my question is if
how would i change the 0 to a 1 in and event and how would i print the monster1 name in text in a window? Thanks.
-SoBe
Code:
[color=#FF0000] Bakugan = Struct.new(:name, :gpower, :attribute, :obtained)
class Bakugan
attr_accessor :id
alias_method :bakugan_init, :initialize
def initialize(*struct_args)
# Calls our struct initialize method
bakugan_init(*struct_args)
# Set @id to be the size of our $data_bakugan list
@id = $data_bakugans.size
# Put our object automatically into the list
$data_bakugans[@id] = self
end
end
$data_bakugans = [nil]
Bakugan.new('monster1', 450, 3, 0)
Bakugan.new('monster2', 450, 3, 0)
Bakugan.new('monster3', 450, 3, 0)
Bakugan.new('monster4', 450, 3, 0)
Bakugan.new('monster5', 450, 3, 0)
Bakugan.new('monster5', 450, 3, 0)[/color]
Code:
[color=#FF0000]Bakugan.new('monster1', 450, 3, 0)[/color] goes to [color=#FF0000]Bakugan.new('monster1', 450, 3, 1)[/color] 0 to one.
-SoBe