设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1415|回复: 6
打印 上一主题 下一主题

ARPG问题:如何在界面上显示EXP经验值?

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-2
帖子
35
跳转到指定楼层
1
发表于 2008-5-8 20:19:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

茄孓

梦石
0
星屑
72
在线时间
140 小时
注册时间
2007-5-29
帖子
956
2
发表于 2008-5-8 20:25:31 | 只看该作者
那你想以什么方式显示呢
文字 还是 图形?
回复 支持 反对

使用道具 举报

Lv2.观梦者

龙骑

梦石
0
星屑
545
在线时间
10 小时
注册时间
2007-12-31
帖子
2030
3
发表于 2008-5-8 20:27:09 | 只看该作者
如果你有能力,可以通过事件来做。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

茄孓

梦石
0
星屑
72
在线时间
140 小时
注册时间
2007-5-29
帖子
956
4
发表于 2008-5-8 20:50:33 | 只看该作者
  1. class Window_Exp < Window_Base
  2.   def initialize
  3.     super(0, 0, 160, 64)
  4.     self.contents = Bitmap.new(width - 32, height - 32)
  5.     refresh
  6.   end
  7.   def refresh
  8.     self.contents.clear
  9.       for i in 0...$game_party.actors.size
  10.       x = 64
  11.       y = i * 116
  12.       actor = $game_party.actors[1]
  13.        exp(actor,0,0)
  14.     end
  15.   end
  16.   def exp(actor,x,y)
  17.     self.contents.fill_rect(x,y,96,16,Color.new(255,255,255,255))
  18.     self.contents.fill_rect(x+1,y+1,94,14,Color.new(0,0,0,255))
  19.     w = 94*$game_actors[1].now_exp/$game_actors[1].next_exp
  20.     self.contents.fill_rect(x+1,y+1,w,14,Color.new(50,255,50,255))
  21.   end
  22. end
  23. class Scene_Map
  24.   def initialize
  25.     @o_exp = $game_actors[1].exp
  26.   end
  27.   alias old_main main
  28.   def main
  29.     @exp = Window_Exp.new
  30.     @exp.x = 0
  31.     @exp.y = 0
  32.     old_main
  33.     @exp.dispose
  34.   end
  35.   alias old_update update
  36.   def update
  37.     if @o_exp != $game_actors[1].exp
  38.       @o_exp = $game_actors[1].exp
  39.       @exp.refresh
  40.     else
  41.       @exp.update
  42.     end
  43.     old_update
  44.   end
  45. end
  46. class Game_Actor
  47.   def now_exp
  48.     return @exp - @exp_list[@level]
  49.   end
  50.   def next_exp
  51.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  52.   end
  53. end
复制代码

这个是我自己工程里弄一段下来给你参考的
直接把脚本复制放到main前就可以``
就是经验条了`
自己可以修改添加
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-2
帖子
35
5
 楼主| 发表于 2008-5-9 02:18:48 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

茄孓

梦石
0
星屑
72
在线时间
140 小时
注册时间
2007-5-29
帖子
956
6
发表于 2008-5-9 05:01:35 | 只看该作者
class Window_Exp < Window_Base
def initialize
   super(0, 0, 160, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
end
def refresh
   self.contents.clear
     for i in 0...$game_party.actors.size
     x = 64
     y = i * 116
     actor = $game_party.actors[1]
      exp(actor,0,0)
   end
end
def exp(actor,x,y)
   self.contents.fill_rect(x,y,96,16,Color.new(255,255,255,255))
   self.contents.fill_rect(x+1,y+1,94,14,Color.new(0,0,0,255))
   w = 94*$game_actors[1].now_exp/$game_actors[1].next_exp
   self.contents.fill_rect(x+1,y+1,w,14,Color.new(50,255,50,255))
end
end
class Scene_Map
def initialize
   @o_exp = $game_actors[1].exp
end
alias old_main main
def main
   @exp = Window_Exp.new
   @exp.x = 0
   @exp.y = 0
   @exp.opacity = 0 # 255可见 0不可见
   
old_main
   @exp.dispose
end
alias old_update update
def update
   if @o_exp != $game_actors[1].exp
     @o_exp = $game_actors[1].exp
     @exp.refresh
   else
     @exp.update
   end
   old_update
end
end
class Game_Actor
def now_exp
   return @exp - @exp_list[@level]
end
def next_exp
   return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-2
帖子
35
7
 楼主| 发表于 2008-5-10 09:16:17 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-27 06:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表