Project1
标题:
如何才能让主角走半格
[打印本页]
作者:
5810707
时间:
2011-8-11 00:51
标题:
如何才能让主角走半格
如题.如何能让主角走半格.以及事件 dsu_plus_rewardpost_czw
作者:
忧雪の伤
时间:
2011-8-11 02:04
像素移动么,目前好像不存在完善的系统……XP的话倒是有……
VX不是很了解的样子,请尝试搜查:
像素移动
作者:
RPGmaster
时间:
2011-8-11 02:11
本帖最后由 RPGmaster 于 2011-8-10 19:13 编辑
#===============================================================
# ● [VX Snippet] ◦ Sprite Mover ◦ □
# * Move sprite in pixel to get right location~ *
#--------------------------------------------------------------
# ◦ by Woratana [
[email protected]
]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 02/06/2008
# ◦ Version: 1.0
#--------------------------------------------------------------
#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# * In the event page that you want to move sprite, add comment:
# MOVE x_plus, y_plus
# ** x_plus: how many pixel you want to move sprite horizontally
# (- number: move left | + number: move right)
# ** y_plus: how many pixel you want to move sprite vertically
# (- number: move up | + number: move down)
# * For example, add comment:
# MOVE 0, -20
# ** to move sprite up 20 pixel~
#==================================================================
class Game_Event < Game_Character
attr_accessor :spr_move
alias wora_mover_gameve_setup setup
def setup(*args)
wora_mover_gameve_setup(*args)
mover = comment?('MOVE', true)
if !mover[0]
@spr_move = nil
else
@spr_move = @list[mover[1]].parameters[0].clone
@spr_move.sub!('MOVE','').gsub!(/\s+/){''}
@spr_move = @spr_move.split(',')
@spr_move.each_index {|i| @spr_move[i] = @spr_move[i].to_i }
end
end
def comment?(comment, return_index = false )
if
[email protected]
?
for i in
[email protected]
- 1
next if @list[i].code != 108
if @list[i].parameters[0].include?(comment)
return [true, i] if return_index
return true
end
end
end
return [false, nil] if return_index
return false
end
end
class Sprite_Character < Sprite_Base
alias wora_mover_sprcha_upd update
def update
wora_mover_sprcha_upd
if @character.is_a?(Game_Event) and
[email protected]
_move.nil?
self.x = @character.screen_x + @character.spr_move[0]
self.y = @character.screen_y + @character.spr_move[1]
end
end
end
复制代码
使用方法:
在事件里添加注释:
MOVE x, y (x,y请自己设定,注意是像素)
这个脚本100%可以用= =
作者:
越前リョーマ
时间:
2011-8-11 02:12
#--------------------------------------------------------------------------
# ● 移动时的更新
#--------------------------------------------------------------------------
def update_move
distance = 2 ** @move_speed # 变换移动速度与移动距离
distance *= 2 if dash? # 跑步状态时移动速度加倍
@real_x = [@real_x - distance, @x * 256].max if @x * 256 < @real_x
@real_x = [@real_x + distance, @x * 256].min if @x * 256 > @real_x
@real_y = [@real_y - distance, @y * 256].max if @y * 256 < @real_y
@real_y = [@real_y + distance, @y * 256].min if @y * 256 > @real_y
update_bush_depth unless moving?
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
复制代码
这里是写角色移动的地方的(在Game_Character),看得出来distance就是移动一步的距离,比如你希望走一步是走半个格子,可以distance *= 0.5 试试……只能说是试试,因为我没试过 = =
XP里ms是直接用加法的……VX里看起来玄乎一点,囧
作者:
RPGmaster
时间:
2011-8-11 02:27
本帖最后由 RPGmaster 于 2011-8-10 19:28 编辑
忧雪の伤 发表于 2011-8-10 19:04
像素移动么,目前好像不存在完善的系统……XP的话倒是有……
VX不是很了解的样子,请尝试搜查:
...
额…………外站很多……给几个:
http://rmrk.net/index.php
http://www.rpg2s.net/
http://www.rpgrevolution.com/forums/
http://rpgfusionv2.forumsrpg.com/forum
http://www.rpgmkr.net/
至于是在哪个网站找到的我就不记得了= =
我去外站很久了= =(各种论坛……)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1