赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 146 |
最后登录 | 2012-8-27 |
在线时间 | 9 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 9 小时
- 注册时间
- 2011-6-29
- 帖子
- 44
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
于是写了一个奇怪的圆形(死
但是实际效果真心吐槽不能(死
诸君求调教>_<~(死- class Sprite_round < Sprite
- def initialize(rid, rx, ry, rwidth, rheight, zoomplus=0.0, zoom=true)
- super()
- @rid = rid
- @rx = rx
- @ry = ry
- @rwidth = rwidth
- @rheight = rheight
- @zoomplus = zoomplus
- @zoom = zoom
- round_update
- end
- def round_update
- case @rid
- when 0..90
- if @rid == 0
- self.ox = @rx
- self.oy = @ry + @rheight
- else
- self.ox = @rx + Math.sin(Math::PI / (180.0 / @rid)) * @rwidth
- self.oy = @ry + Math.cos(Math::PI / (180.0 / @rid)) * @rheight
- end
- when 91..180
- self.ox = @rx + Math.cos(Math::PI / (180.0 / (@rid-90))) * @rwidth
- self.oy = @ry - Math.sin(Math::PI / (180.0 / (@rid-90))) * @rheight
- when 181..270
- self.ox = @rx - Math.sin(Math::PI / (180.0 / (@rid-180))) * @rwidth
- self.oy = @ry - Math.cos(Math::PI / (180.0 / (@rid-180))) * @rheight
- when 271..360
- self.ox = @rx - Math.cos(Math::PI / (180.0 / (@rid-270))) * @rwidth
- self.oy = @ry + Math.sin(Math::PI / (180.0 / (@rid-270))) * @rheight
- end
- self.x = self.ox * 2
- self.y = self.oy * 2
- self.z = self.oy
- self.zoom_x = self.zoom_y = self.oy / 480.0 + @zoomplus if @zoom
- end
- end
复制代码 |
|