Project1
标题:
圆形半成品求调教(死
[打印本页]
作者:
~❤
时间:
2011-7-8 18:49
标题:
圆形半成品求调教(死
于是写了一个奇怪的圆形(死
但是实际效果真心吐槽不能(死
诸君求调教>_<~(死
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
复制代码
作者:
忧雪の伤
时间:
2011-7-8 18:50
Sprite_round这习惯不好……
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1