Project1
标题:
如何将[跑步]另指定行走图?
[打印本页]
作者:
sballance
时间:
2015-2-27 21:01
标题:
如何将[跑步]另指定行走图?
用走路的图来跑步看起来的确很捉鸡啊......另外怎么更改跑步速度以及添加其他陆上交通工具(速度更快的)呢?{:2_285:}
作者:
三途亚梦
时间:
2015-2-27 21:15
你可以去图书馆里找到一个脚本,它可以更方便的支持多帧行走图,8方向和行走图的自动切换
作者:
tseyik
时间:
2015-2-27 21:48
スタンド&ラン(stand&run)
# 待機中画像的文件名末尾「_stand」
# 移動中の画像的文件名末尾「_run」。
# 「「xxxxxx」「xxxxxx_stand」和「xxxxxx_run」画像対応。
# 必一set準備。
#
#==============================================================================
# 「スタンド&ラン」(ACE) ver1.1
# 製作者:奈々(なな)
# へぷたなすくろーる http://heptanas.mamagoto.com/
#
# ◇使用規約
# 使用される場合はスクリプト作成者として「奈々」を明記して下さい。
# このスクリプトを改変したり、改変したものを配布するなどは自由ですが
# その場合も元のスクリプトの作成者として名前は載せて下さい。
# その他、詳しい利用規約はブログを参照して下さい。
#
#------------------------------------------------------------------------------
#
# 待機中の画像はファイル名の末尾に「_stand」と
# 移動中の画像はファイル名の末尾に「_run」と付けて下さい。
# 「xxxxxx_stand」と「xxxxxx_run」の画像が対応します。
# 必ずセットで用意して下さい。
#
# キャラクターの画像にはstandの画像を指定します。
# stand画像を指定したキャラクター(プレイヤーやイベント)は
# 移動していないときはstand画像でゆっくりと足踏みします。
# 移動しているときはrun画像に切り替わります。
# standとrun以外の画像を指定したキャラクターは従来通りの動きをします。
#
#==============================================================================
#==============================================================================
# ■ Game_CharacterBase
#------------------------------------------------------------------------------
# キャラクターを扱う基本のクラスです。全てのキャラクターに共通する、座標やグ
# ラフィックなどの基本的な情報を保持します。
#==============================================================================
class Game_CharacterBase
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :step_anime # 足踏みアニメ
#--------------------------------------------------------------------------
# ● グラフィックの変更
# character_name : 新しい歩行グラフィック ファイル名
# character_index : 新しい歩行グラフィック インデックス
#--------------------------------------------------------------------------
def set_graphic(character_name, character_index)
@tile_id = 0
@character_name = character_name
@character_index = character_index
@original_pattern = 1
if @character_name[-6, 6] == "_stand"
@step_anime = true
end
end
#--------------------------------------------------------------------------
# ● 歩行/足踏みアニメの更新
#--------------------------------------------------------------------------
def update_animation
update_anime_count
temp = real_move_speed
temp = 1 if @character_name[-6, 6] == "_stand"
if @anime_count > 18 - real_move_speed * 2
update_anime_pattern
@anime_count = 0
end
end
end
#==============================================================================
# ■ Sprite_Character
#------------------------------------------------------------------------------
# キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
# 監視し、スプライトの状態を自動的に変化させます。
#==============================================================================
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# character : Game_Character
#--------------------------------------------------------------------------
def initialize(viewport, character = nil)
super(viewport)
@character = character
@balloon_duration = 0
@stand_delay = 0
@run_delay = 0
if @character
if @character.character_name[-6, 6] == "_stand"
@character.step_anime = true
end
end
update
end
#--------------------------------------------------------------------------
# ● 転送元ビットマップの更新
#--------------------------------------------------------------------------
def update_bitmap
if graphic_changed?
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_index = @character.character_index
if @tile_id > 0
set_tile_bitmap
else
set_character_bitmap
end
else
stand_and_run
end
end
#--------------------------------------------------------------------------
# ● stand&runの判定と処理
#--------------------------------------------------------------------------
def stand_and_run
if @character.moving? == true && @character_name[-6, 6] == "_stand"
@run_delay += 1
if @run_delay >= 6
@run_delay = 0
@character_name[-6, 6] = "_run"
@character.step_anime = false
set_character_bitmap
end
elsif @character.moving? == false && @character_name[-4, 4] == "_run"
@stand_delay += 1
if @stand_delay >= 15
@stand_delay = 0
@character_name[-4, 4] = "_stand"
@character.step_anime = true
set_character_bitmap
end
else
@stand_delay = 0
@run_delay = 0
end
end
end
复制代码
作者:
sballance
时间:
2015-2-27 22:01
三途亚梦 发表于 2015-2-27 21:15
你可以去图书馆里找到一个脚本,它可以更方便的支持多帧行走图,8方向和行走图的自动切换 ...
谢谢,已经解决了~那知道交通工具该怎么弄吗?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1