05-24-2017, 05:47 AM
(This post was last modified: 05-24-2017, 05:57 AM by DerVVulfman.)
Yep.
BUT!!!! To achieve the same feature for events, place the same attr_accessor statement within Game_Character and Game_Event.
That way, you can use:
$game_map.events[event_id].move_speed = value
attr_accessor allows you to read and write the specified value to/from that class.
attr_reader allows you ONLY to read from that class (within reason)
The Event and Player classes merely 'inherit' data and methods from Game_Character....
.... (Game_Player < Game_Character ) ....
So you don't need to add all the methods from Game_Character into Game_Player. There is no 'moving' or 'jumping' methods in Game_Player. But they exist in Game_Character. ;) Game_Player is what we call a 'child' class. It's daddy is Game_Character, and since the methods are in Character.... Player has access to them.
But you still want to add the attr_accessor statements to all the classes.
BUT!!!! To achieve the same feature for events, place the same attr_accessor statement within Game_Character and Game_Event.
That way, you can use:
$game_map.events[event_id].move_speed = value
attr_accessor allows you to read and write the specified value to/from that class.
attr_reader allows you ONLY to read from that class (within reason)
The Event and Player classes merely 'inherit' data and methods from Game_Character....
.... (Game_Player < Game_Character ) ....
So you don't need to add all the methods from Game_Character into Game_Player. There is no 'moving' or 'jumping' methods in Game_Player. But they exist in Game_Character. ;) Game_Player is what we call a 'child' class. It's daddy is Game_Character, and since the methods are in Character.... Player has access to them.
But you still want to add the attr_accessor statements to all the classes.