赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 2 |
经验 | 0 |
最后登录 | 2022-6-7 |
在线时间 | 19 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 155
- 在线时间
- 19 小时
- 注册时间
- 2021-11-11
- 帖子
- 4
|
2楼
楼主 |
发表于 2022-4-1 00:23:27
|
只看该作者
这里是完整的代码,大佬们可以看一下
- # also need to override 'dispose'
- # Adding WMTS state into savable Game_Map instance
- =begin
- :PlayerHealth
- {
- :x
- :y
- :sx
- :sy
- :width
- }
- class Game_Map
- attr_accessor :PlayerHealth
- end
- #dispose
- bitmap.dispose if bitmap
- =end
- #
- =begin
- class Spriteset_Map
- alias base_initialize initialize
- alias base_update update
- alias base_dispose dispose
- def initialize(*args)
- puts "$$ Spriteset_Map initialize"
- # initialize health bar UI
- HealthBarWindowController.create
- PlayerHealth.create
- EnemyHealth.create
- HealthBarController.setup
- # call base
- base_initialize(*args)
- end
- def update(*args)
- #puts "$$ Spriteset_Map update"
- # call base
- base_update(*args)
- # update health bar UI
- PlayerHealth.update
- EnemyHealth.update
- # update WMTS (World Map Travel System)
- WMTS.update
- end
- def dispose(*args)
- puts "$$ Spriteset_Map dispose"
- # call base
- base_dispose(*args)
- # dispose health bar UI
- PlayerHealth.dispose
- EnemyHealth.dispose
- HealthBarWindowController.dispose
- end
- end
- =end
- # cleaned up version
- class Spriteset_Map
- alias base_initialize initialize
- alias base_update update
- alias base_dispose dispose
- def initialize(*args)
- #
- puts "Spriteset_Map CREATE CALL"
- $Entites.create
- # call base
- base_initialize(*args)
- end
- def update(*args)
- # call base
- base_update(*args)
- #
- $Entites.update
- end
- def dispose(*args)
- # call base
- base_dispose(*args)
- puts "Spriteset_Map DISPOSE CALL"
-
- #
- $Entites.dispose
- end
- end
复制代码 |
|