- 注册时间
- 2004-11-7
- 最后登录
- 2009-7-28
⑦老手
pliskin
- 积分
- 7004
|
先说一下,脚本很容易理解,但是对制作的要求很高。有兴趣的,请一步步的做
1,class Game_Variables下面加上
attr_accessor:ma
在def initialize下面加上
@ma = []
在这个类的最后写上
def 当前坐标
x=$game_player.x
y=$game_player.y
if $game_variables.ma.include?([x,y]) == true
return $game_variables.ma
end
else
$game_variables.ma.push [x,y]
end
以上就很明显了,就是把角色的坐标推到数组中
2,写一个窗口脚本,如下复制就可以了
class Window_map < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
x1=$game_player.x
y2=$game_player.y
n=0
while n<$game_variables.ma.size
x = $game_variables.ma[n][0]
y = $game_variables.ma[n][1]
self.contents.fill_rect(x*32, y*32, 32, 32, knockout_color)
n+=1
end
self.contents.fill_rect(x1*32, y2*32, 32, 32, crisis_color)
end
end
3,写一个简单的场景脚本,复制就可以了
class Scene_dcf
def main
@map_window=Window_map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@map_window.dispose
end
def update
@map_window.update
if @map_window.active
update_command
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return end
end
end
----------------------以上就是脚本部分,接下来是时间的设计----------------------
1, 开启一个并行处理事件:在脚本的那个筐中写 $game_variables.当前坐标
2,设计一个道具,比如“地图查看”,连接公共事件“地图查看”
公共事件“地图查看”:脚本的那个筐中写$scene=Scene_sizz.new
游戏开始得到道具:“地图查看”
----------------------下面是实验部分---------------------------------
走几步,然后使用道具“地图查看”,就可以看到效果。红色是你走过的路,黄色是你当前的位置
--------------------------------------难点-----------------------------------------------------------
地图的窗口的绘制 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|