查看: 1601|回复: 0

[已经过期] 道具产生错误问题求解!

[复制链接]
梦石
0
星屑
49
在线时间
177 小时
注册时间
2011-7-3
回帖
133
发表于 2012-1-12 18:09:47 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 TheRebirth 于 2012-1-12 18:10 编辑

(唉...这讨厌的表情...)

如下图和脚本:
class TShoot_Enemy6 < TShoot_Enemy
  def set_type
    @hp = 80 + $difficulty * 20
    @point = 4
    @power = 4
    @file_name = "Monster2.png"
    @file_index = 1
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    whirl_shot(2 + $difficulty / 3 * 2,768,rand(4),2)
    basic_move3(1200)
  end
end

根据脚本,击破该敌人后应该产生四个"点"和四个"pOWER",但是这里只有"pOWER",一个"点"也木有...(↓)

Cache2.PNG

虽然说我弄的东西配色的确拙了点,但是这个应该也无关紧要了吧...

个人认为是不是这里出问题了?

def set_item
    n = @score + @power + @life + @bomb + @money + @bigmoney + @bigpower
    return if n == 0
    a = -Math::PI / 2
    for i in 0...@score
      d = Math::PI * 2 / @score
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 0)
      a += d
    end
    for i in 0...@power
      d = Math::PI * 2 / @power
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 1)
      a += d
    end
    for i in 0...@life
      d = Math::PI * 2 / @life
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 2)
      a += d
    end
    for i in 0...@bomb
      d = Math::PI * 2 / @bomb
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 3)
      a += d
    end
    for i in 0...@money
      d = Math::PI * 2 / @money
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 4)
      a += d
    end
    for i in 0...@bigmoney
      d = Math::PI * 2 / @bigmoney
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 5)
      a += d
    end
    for i in 0...@bigpower
      d = Math::PI * 2 / @bigpower
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 6)
      a += d
    end
  end

全脚本在此...
Scripts.rvdata (156.8 KB, 下载次数: 33)

点评

说真的,用代码括起来脚本真的那么难么?  发表于 2012-1-12 18:15
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部