赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 23398 |
最后登录 | 2017-2-17 |
在线时间 | 1055 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1055 小时
- 注册时间
- 2010-6-17
- 帖子
- 85
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 「旅」 于 2010-7-4 16:23 编辑
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # ● 初始化变量
- #--------------------------------------------------------------------------
- def initialize
- @viewport1 = Viewport.new(0, 60, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport4 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 101
- @viewport3.z = 200
- @viewport4.z = 5000
- # 生成战斗背景活动块
- [color=red] @viewport5 = Viewport.new(0,0,640,480)
- @battleback_sprite = Sprite.new(@viewport5[/color])
- # 生成敌人活动块
- @enemy_sprites = []
- for enemy in $game_troop.enemies.reverse
- # @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
- @enemy_sprites.push(Sprite_Battler.new(@viewport4, enemy))#敌人的显示高度
- end
- # 生成敌人活动块
- @actor_sprites = []
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- # 生成天候
- @weather = RPG::Weather.new(@viewport1)
- # 生成图片活动块
- @picture_sprites = []
- for i in 51..100
- @picture_sprites.push(Sprite_Picture.new(@viewport3,
- $game_screen.pictures[i]))
- end
- # 生成计时器块
- @timer_sprite = Sprite_Timer.new
- # 刷新画面
- update
- end
- #..........................................................................
- #--------------------------------------------------------------------------
- # ● 胜利图
- #--------------------------------------------------------------------------
- def win
- for sprite in @actor_sprites
- sprite.win
- end
- end
- #..........................................................................
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新角色的活动块 (对应角色的替换)
- @actor_sprites[0].battler = $game_party.actors[0]
- @actor_sprites[1].battler = $game_party.actors[1]
- @actor_sprites[2].battler = $game_party.actors[2]
- @actor_sprites[3].battler = $game_party.actors[3]
- # 战斗背景的文件名与现在情况有差异的情况下
- if @battleback_name != $game_temp.battleback_name
- @battleback_name = $game_temp.battleback_name
- if @battleback_sprite.bitmap != nil
- @battleback_sprite.bitmap.dispose
- end
- @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
- @battleback_sprite.src_rect.set(0, 0, 640, 480)
- end
- # 刷新战斗者的活动块
- for sprite in @enemy_sprites + @actor_sprites
- sprite.update
- end
- # 刷新天气图形
- @weather.type = $game_screen.weather_type
- @weather.max = $game_screen.weather_max
- @weather.update
- # 刷新图片活动块
- for sprite in @picture_sprites
- sprite.update
- end
- # 刷新计时器活动块
- @timer_sprite.update
- # 设置画面的色调与震动位置
- @viewport1.tone = $game_screen.tone
- @viewport1.ox = $game_screen.shake
- # 设置画面的闪烁色
- @viewport4.color = $game_screen.flash_color
- # 刷新显示端口
- @viewport1.update
- @viewport2.update
- @viewport4.update
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取光标指向的敌人
- #--------------------------------------------------------------------------
- def enemy
- return $game_troop.enemies[@index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 如果指向不存在的敌人就离开
- $game_troop.enemies.size.times do
- break if self.enemy.exist?
- @index += 1
- @index %= $game_troop.enemies.size
- end
- # 光标右
- if Input.repeat?(Input::RIGHT)
- $game_system.se_play($data_system.cursor_se)
- $game_troop.enemies.size.times do
- @index += 1
- @index %= $game_troop.enemies.size
- break if self.enemy.exist?
- end
- end
- # 光标左
- if Input.repeat?(Input::LEFT)
- $game_system.se_play($data_system.cursor_se)
- $game_troop.enemies.size.times do
- @index += $game_troop.enemies.size - 1
- @index %= $game_troop.enemies.size
- break if self.enemy.exist?
- end
- end
- # 设置活动块坐标
- if self.enemy != nil
- self.x = self.enemy.screen_x + self.ox
- self.y = self.enemy.screen_y + self.oy
- end
- end
- class Arrow_Actor < Arrow_Base
- #--------------------------------------------------------------------------
- # ● 获取光标指向的角色
- #--------------------------------------------------------------------------
- def actor
- return $game_party.actors[@index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 光标右
- if Input.repeat?(Input::RIGHT)
- $game_system.se_play($data_system.cursor_se)
- @index += 1
- @index %= $game_party.actors.size
- end
- # 光标左
- if Input.repeat?(Input::LEFT)
- $game_system.se_play($data_system.cursor_se)
- @index += $game_party.actors.size - 1
- @index %= $game_party.actors.size
- end
- # 设置活动块坐标
- if self.actor != nil
- self.x = self.actor.screen_x + self.ox
- self.y = self.actor.screen_y + self.oy
- end
- end
- end
复制代码 改了红色的那里,使战斗背景全面化了
但是改好后指针不见了,再改回来又有了,
- -
怎么解决? |
|