Posted: Sat Jul 15, 2006 9:33 pm Post subject: Profundidade
Aew gente blz???
sou eu novamente
nesse script vamos aprender a fazer profundidades como a imagem abaixo.
qualquer dúvidaposte aki ou me add ou me mande um e-mail pra ltk-@hotmail.com
flw e divirtam-se com o script
Code:
#######################################################################################
############################# XRXS ####################################################
#######################################################################################
#O script permite que o battler tenha o efeito de profundidade.
#######################################################################################
class Game_Battler
attr_accessor :x_pos
attr_accessor :y_pos
attr_accessor :z_pos
attr_accessor :zoom
end
class Game_Enemy < Game_Battler
alias xrxs_bp9_initialize initialize
def initialize(troop_id, member_index)
@x_pos = $data_troops[troop_id].members[member_index].x - 320
@y_pos = -($data_troops[troop_id].members[member_index].y - 304)
@z_pos = 0
@zoom = 1.00
@field_x_offset = @field_x_offset != nil ? @field_x_offset : 0
@field_y_offset = @field_y_offset != nil ? @field_y_offset : 0
xrxs_bp9_initialize(troop_id, member_index)
end
def screen_x
$xcam_x = $xcam_x != nil ? $xcam_x : 0
return 320 - @field_x_offset + (@x_pos) * @zoom - $xcam_x
end
def screen_y
$xcam_y = $xcam_y != nil ? $xcam_y : 0
return 240 - @field_y_offset + (-@y_pos + 64) * @zoom - $xcam_y
end
end
class Sprite_Battler < RPG::Sprite
alias xrxs_bp9_update update
def update
zoom = 1.0
@z_offset = 0
xrxs_bp9_update
if @battler.is_a?(Game_Enemy)
@z_offset -= @battler.y_pos
zoom = 1.00 * 185 / (($xcam_z != nil ? $xcam_z : 185) - @z_offset)
self.zoom_x = zoom
self.zoom_y = zoom
@battler.zoom = zoom
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum