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

Project1

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

[已经解决] 【求教】 RMXP如何制作天气

[复制链接]

Lv1.梦旅人

梦石
0
星屑
285
在线时间
2 小时
注册时间
2013-9-14
帖子
4
跳转到指定楼层
1
发表于 2013-9-14 21:08:18 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 52t3485 于 2013-9-14 21:38 编辑

{:2_253:} 想弄一个风沙的天气  但是软件自带的没有 所以想请教下 怎么做

Lv1.梦旅人

梦石
0
星屑
285
在线时间
2 小时
注册时间
2013-9-14
帖子
4
5
 楼主| 发表于 2013-9-19 16:42:06 | 只看该作者
guoyq1988 发表于 2013-9-14 22:31
第一个问题,论坛搜索有
第二个问题,论坛搜索也有
第三个问题,论坛搜索还是有

谢谢帮忙  其实不是没搜过 而是无论怎么弄 都会自己回到广场的页面  然后只好问了 = =  
呃...总之 万分感谢o(∩_∩)o

点评

这个是有解决办法的  发表于 2013-9-19 17:39
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
4
发表于 2013-9-14 22:31:39 | 只看该作者
本帖最后由 guoyq1988 于 2013-9-14 22:32 编辑

第一个问题,论坛搜索有
第二个问题,论坛搜索也有
第三个问题,论坛搜索还是有
你就不能搜索下在问么?还三连呀!

看在是新人的份上就帮你一把

天气
  1. #===========================
  2. # ccoa's weather script
  3. # with ideas by ScriptKitty and Mr.DJ

  4. #===========================
  5. # Weather Types:类型
  6. # 1 - rain  雨
  7. # 2 - storm 风
  8. # 3 - snow 雪
  9. # 4 - hail  冰雹
  10. # 5 - rain with thunder and lightning  雷雨
  11. # 6 - falling leaves (autumn) 秋天的落叶
  12. # 7 - blowing leaves (autumn)         秋风扫落叶
  13. # 8 - swirling leaves (autumn) 旋转的树叶
  14. # 9 - falling leaves (green) 绿绿的落叶
  15. # 10 - cherry blossom (sakura) petals 樱花飞舞
  16. # 11 - rose petals 玫瑰花瓣雨
  17. # 12 - feathers 羽毛
  18. # 13 - blood rain 血雨
  19. # 14 - sparkles 闪烁
  20. # 15 - user defined 自己定义
  21. #
  22. # Weather Power:  强度 0-40  0为无天气
  23. # An integer from 0-40. 0 = no weather, 40 = 400 sprites
  24. #
  25. # Usage:使用方法
  26. # Create a call script with the following:
  27. # 调用这个脚本
  28. # $game_screen.weather(type, power, hue)
  29. # 比如:$game_screen.weather(14, 35, 0)
  30. #
  31. # Usage of user-defined weather:
  32. # Look at the following globals:
  33. # 自定义天气看下面的

  34. $WEATHER_UPDATE = false
  35. # the $WEATHER_IMAGES array has changed, please update天气图象改变请改为true
  36. $WEATHER_IMAGES = []
  37. # the array of picture names to use用到的图片名字,默认无,所以上面不用刷新(他不是小方块!)
  38. $WEATHER_X = 0
  39. # the number of pixels the image should move horizontally (positive = right, negative = left)水平移动,正为右,负为左
  40. $WEATHER_Y = 0
  41. # the number of pizels the image should move vertically (positive = down, negative = up)垂直运动,正为下,负为上
  42. $WEATHER_FADE = 0
  43. # how much the image should fade each update (0 = no fade, 255 = fade instantly)淡出淡入,0为无,255为马上
  44. $WEATHER_ANIMATED = false
  45. # whether or not the image should cycle through all the images是否环绕?

  46. module RPG
  47. class Weather
  48. def initialize(viewport = nil)
  49. @type = 0
  50. [url=home.php?mod=space&uid=25307]@Max[/url] = 0
  51. @ox = 0
  52. @oy = 0
  53. @count = 0
  54. @current_pose = []
  55. @info = []
  56. @countarray = []

  57. make_bitmaps

  58. # **** ccoa ****
  59. for i in 1..500
  60. sprite = Sprite.new(viewport)
  61. sprite.z = 1000
  62. sprite.visible = false
  63. sprite.opacity = 0
  64. @sprites.push(sprite)
  65. @current_pose.push(0)
  66. @info.push(rand(50))
  67. @countarray.push(rand(15))
  68. end
  69. end

  70. def dispose
  71. for sprite in @sprites
  72. sprite.dispose
  73. end
  74. @rain_bitmap.dispose
  75. @storm_bitmap.dispose
  76. @snow_bitmap.dispose
  77. @hail_bitmap.dispose
  78. @petal_bitmap.dispose
  79. @blood_rain_bitmap.dispose
  80. for image in @autumn_leaf_bitmaps
  81. image.dispose
  82. end
  83. for image in @green_leaf_bitmaps
  84. image.dispose
  85. end
  86. for image in @rose_bitmaps
  87. image.dispose
  88. end
  89. for image in @feather_bitmaps
  90. image.dispose
  91. end
  92. for image in @sparkle_bitmaps
  93. image.dispose
  94. end
  95. for image in @user_bitmaps
  96. image.dispose
  97. end
  98. $WEATHER_UPDATE = true
  99. end

  100. def type=(type)
  101. return if @type == type
  102. @type = type
  103. case @type
  104. when 1 # rain
  105. bitmap = @rain_bitmap
  106. when 2 # storm
  107. bitmap = @storm_bitmap
  108. when 3 # snow
  109. bitmap = @snow_bitmap
  110. when 4 # hail
  111. bitmap = @hail_bitmap
  112. when 5 # rain w/ thunder and lightning
  113. bitmap = @rain_bitmap
  114. [url=home.php?mod=space&uid=34616]@thunder[/url] = true
  115. when 6 # falling autumn leaves
  116. bitmap = @autumn_leaf_bitmaps[0]
  117. when 7 # blowing autumn leaves
  118. bitmap = @autumn_leaf_bitmaps[0]
  119. when 8 # swirling autumn leaves
  120. bitmap = @autumn_leaf_bitmaps[0]
  121. when 9 # falling green leaves
  122. bitmap = @green_leaf_bitmaps[0]
  123. when 10 # sakura petals
  124. bitmap = @petal_bitmap
  125. when 11 # rose petals
  126. bitmap = @rose_bitmaps[0]
  127. when 12 # feathers
  128. bitmap = @feather_bitmaps[0]
  129. when 13 # blood rain
  130. bitmap = @blood_rain_bitmap
  131. when 14 # sparkles
  132. bitmap = @sparkle_bitmaps[0]
  133. when 15 # user-defined
  134. bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  135. else
  136. bitmap = nil
  137. end
  138. if @type != 5
  139. [url=home.php?mod=space&uid=34616]@thunder[/url] = false
  140. end
  141. # **** ccoa ****
  142. for i in 1..500
  143. sprite = @sprites[i]
  144. if sprite != nil
  145. sprite.visible = (i <= @max)
  146. sprite.bitmap = bitmap
  147. end
  148. end
  149. end

  150. def ox=(ox)
  151. return if @ox == ox;
  152. @ox = ox
  153. for sprite in @sprites
  154. sprite.ox = @ox
  155. end
  156. end

  157. def oy=(oy)
  158. return if @oy == oy;
  159. @oy = oy
  160. for sprite in @sprites
  161. sprite.oy = @oy
  162. end
  163. end

  164. def max=(max)
  165. return if [url=home.php?mod=space&uid=25307]@Max[/url] == max;
  166. # **** ccoa ****
  167. @max = [[max, 0].max, 500].min
  168. for i in 1..500
  169. sprite = @sprites[i]
  170. if sprite != nil
  171. sprite.visible = (i <= @max)
  172. end
  173. end
  174. end

  175. def update
  176. return if @type == 0
  177. for i in 1..@max
  178. sprite = @sprites[i]
  179. if sprite == nil
  180. break
  181. end
  182. if @type == 1 or @type == 5 or @type == 13 # rain
  183. sprite.x -= 2
  184. sprite.y += 16
  185. sprite.opacity -= 8
  186. if @thunder and (rand(8000 - @max) == 0)
  187. $game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
  188. Audio.se_play("Audio/SE/061-Thunderclap01")
  189. end
  190. end
  191. if @type == 2 # storm
  192. sprite.x -= 8
  193. sprite.y += 16
  194. sprite.opacity -= 12
  195. end
  196. if @type == 3 # snow
  197. sprite.x -= 2
  198. sprite.y += 8
  199. sprite.opacity -= 8
  200. end
  201. if @type == 4 # hail
  202. sprite.x -= 1
  203. sprite.y += 18
  204. sprite.opacity -= 15
  205. end
  206. if @type == 6 # falling autumn leaves
  207. @count = rand(20)
  208. if @count == 0
  209. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  210. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  211. end
  212. sprite.x -= 1
  213. sprite.y += 1
  214. end
  215. if @type == 7 # blowing autumn leaves
  216. @count = rand(20)
  217. if @count == 0
  218. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  219. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  220. end
  221. sprite.x -= 10
  222. sprite.y += (rand(4) - 2)
  223. end
  224. if @type == 8 # swirling autumn leaves
  225. @count = rand(20)
  226. if @count == 0
  227. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  228. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  229. end
  230. if @info[i] != 0
  231. if @info[i] >= 1 and @info[i] <= 10
  232. sprite.x -= 3
  233. sprite.y -= 1
  234. elsif @info[i] >= 11 and @info[i] <= 16
  235. sprite.x -= 1
  236. sprite.y -= 2
  237. elsif @info[i] >= 17 and @info[i] <= 20
  238. sprite.y -= 3
  239. elsif @info[i] >= 21 and @info[i] <= 30
  240. sprite.y -= 2
  241. sprite.x += 1
  242. elsif @info[i] >= 31 and @info[i] <= 36
  243. sprite.y -= 1
  244. sprite.x += 3
  245. elsif @info[i] >= 37 and @info[i] <= 40
  246. sprite.x += 5
  247. elsif @info[i] >= 41 and @info[i] <= 46
  248. sprite.y += 1
  249. sprite.x += 3
  250. elsif @info[i] >= 47 and @info[i] <= 58
  251. sprite.y += 2
  252. sprite.x += 1
  253. elsif @info[i] >= 59 and @info[i] <= 64
  254. sprite.y += 3
  255. elsif @info[i] >= 65 and @info[i] <= 70
  256. sprite.x -= 1
  257. sprite.y += 2
  258. elsif @info[i] >= 71 and @info[i] <= 81
  259. sprite.x -= 3
  260. sprite.y += 1
  261. elsif @info[i] >= 82 and @info[i] <= 87
  262. sprite.x -= 5
  263. end
  264. @info[i] = (@info[i] + 1) % 88
  265. else
  266. if rand(200) == 0
  267. @info[i] = 1
  268. end
  269. sprite.x -= 5
  270. sprite.y += 1
  271. end
  272. end
  273. if @type == 9 # falling green leaves
  274. if @countarray[i] == 0
  275. @current_pose[i] = (@current_pose[i] + 1) % @green_leaf_bitmaps.size
  276. sprite.bitmap = @green_leaf_bitmaps[@current_pose[i]]
  277. @countarray[i] = rand(15)
  278. end
  279. @countarray[i] = (@countarray[i] + 1) % 15
  280. sprite.y += 1
  281. end
  282. if @type == 10 # sakura petals
  283. if @info[i] < 25
  284. sprite.x -= 1
  285. else
  286. sprite.x += 1
  287. end
  288. @info[i] = (@info[i] + 1) % 50
  289. sprite.y += 1
  290. end
  291. if @type == 11 # rose petals
  292. @count = rand(20)
  293. if @count == 0
  294. sprite.bitmap = @rose_bitmaps[@current_pose[i]]
  295. @current_pose[i] = (@current_pose[i] + 1) % @rose_bitmaps.size
  296. end
  297. if @info[i] % 2 == 0
  298. if @info[i] < 10
  299. sprite.x -= 1
  300. else
  301. sprite.x += 1
  302. end
  303. end
  304. sprite.y += 1
  305. end
  306. if @type == 12 # feathers
  307. if @countarray[i] == 0
  308. @current_pose[i] = (@current_pose[i] + 1) % @feather_bitmaps.size
  309. sprite.bitmap = @feather_bitmaps[@current_pose[i]]
  310. end
  311. @countarray[i] = (@countarray[i] + 1) % 15
  312. if rand(100) == 0
  313. sprite.x -= 1
  314. end
  315. if rand(100) == 0
  316. sprite.y -= 1
  317. end
  318. if @info[i] < 50
  319. if rand(2) == 0
  320. sprite.x -= 1
  321. else
  322. sprite.y -= 1
  323. end
  324. else
  325. if rand(2) == 0
  326. sprite.x += 1
  327. else
  328. sprite.y += 1
  329. end
  330. end
  331. @info[i] = (@info[i] + 1) % 100
  332. end
  333. if @type == 14 # sparkles
  334. if @countarray[i] == 0
  335. @current_pose[i] = (@current_pose[i] + 1) % @sparkle_bitmaps.size
  336. sprite.bitmap = @sparkle_bitmaps[@current_pose[i]]
  337. end
  338. @countarray[i] = (@countarray[i] + 1) % 15
  339. sprite.y += 1
  340. sprite.opacity -= 1
  341. end
  342. if @type == 15 # user-defined
  343. if $WEATHER_UPDATE
  344. update_user_defined
  345. $WEATHER_UPDATE = false
  346. end
  347. if $WEATHER_ANIMATED and @countarray[i] == 0
  348. @current_pose[i] = (@current_pose[i] + 1) % @user_bitmaps.size
  349. sprite.bitmap = @user_bitmaps[@current_pose[i]]
  350. end
  351. @countarray[i] = (@countarray[i] + 1) % 15
  352. sprite.x += $WEATHER_X
  353. sprite.y += $WEATHER_Y
  354. sprite.opacity -= $WEATHER_FADE
  355. end

  356. x = sprite.x - @ox
  357. y = sprite.y - @oy
  358. if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
  359. sprite.x = rand(800) - 50 + @ox
  360. sprite.y = rand(800) - 200 + @oy
  361. sprite.opacity = 255
  362. end
  363. end
  364. end

  365. def make_bitmaps
  366. color1 = Color.new(255, 255, 255, 255)
  367. color2 = Color.new(255, 255, 255, 128)
  368. @rain_bitmap = Bitmap.new(7, 56)
  369. for i in 0..6
  370. @rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
  371. end
  372. @storm_bitmap = Bitmap.new(34, 64)
  373. for i in 0..31
  374. @storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
  375. @storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
  376. @storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
  377. end
  378. @snow_bitmap = Bitmap.new(6, 6)
  379. @snow_bitmap.fill_rect(0, 1, 6, 4, color2)
  380. @snow_bitmap.fill_rect(1, 0, 4, 6, color2)
  381. @snow_bitmap.fill_rect(1, 2, 4, 2, color1)
  382. @snow_bitmap.fill_rect(2, 1, 2, 4, color1)
  383. @sprites = []

  384. blueGrey = Color.new(215, 227, 227, 150)
  385. grey = Color.new(214, 217, 217, 150)
  386. lightGrey = Color.new(233, 233, 233, 250)
  387. lightBlue = Color.new(222, 239, 243, 250)
  388. @hail_bitmap = Bitmap.new(4, 4)
  389. @hail_bitmap.fill_rect(1, 0, 2, 1, blueGrey)
  390. @hail_bitmap.fill_rect(0, 1, 1, 2, blueGrey)
  391. @hail_bitmap.fill_rect(3, 1, 1, 2, grey)
  392. @hail_bitmap.fill_rect(1, 3, 2, 1, grey)
  393. @hail_bitmap.fill_rect(1, 1, 2, 2, lightGrey)
  394. @hail_bitmap.set_pixel(1, 1, lightBlue)


  395. color3 = Color.new(255, 167, 192, 255) # light pink
  396. color4 = Color.new(213, 106, 136, 255) # dark pink
  397. @petal_bitmap = Bitmap.new(4, 4) #This creates a new bitmap that is 4 x 4 pixels
  398. @petal_bitmap.fill_rect(0, 3, 1, 1, color3) # this makes a 1x1 pixel "rectangle" at the 0, 3 pixel of the image (upper left corner is 0, 0)
  399. @petal_bitmap.fill_rect(1, 2, 1, 1, color3)
  400. @petal_bitmap.fill_rect(2, 1, 1, 1, color3)
  401. @petal_bitmap.fill_rect(3, 0, 1, 1, color3)
  402. @petal_bitmap.fill_rect(1, 3, 1, 1, color4)
  403. @petal_bitmap.fill_rect(2, 2, 1, 1, color4)
  404. @petal_bitmap.fill_rect(3, 1, 1, 1, color4)


  405. brightOrange = Color.new(248, 88, 0, 255)
  406. orangeBrown = Color.new(144, 80, 56, 255)
  407. burntRed = Color.new(152, 0, 0, 255)
  408. paleOrange = Color.new(232, 160, 128, 255)
  409. darkBrown = Color.new(72, 40, 0, 255)
  410. @autumn_leaf_bitmaps = []
  411. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  412. # draw the first of the leaf1 bitmaps
  413. @autumn_leaf_bitmaps[0].set_pixel(5, 1, orangeBrown)
  414. @autumn_leaf_bitmaps[0].set_pixel(6, 1, brightOrange)
  415. @autumn_leaf_bitmaps[0].set_pixel(7, 1, paleOrange)
  416. @autumn_leaf_bitmaps[0].set_pixel(3, 2, orangeBrown)
  417. @autumn_leaf_bitmaps[0].fill_rect(4, 2, 2, 1, brightOrange)
  418. @autumn_leaf_bitmaps[0].set_pixel(6, 2, paleOrange)
  419. @autumn_leaf_bitmaps[0].set_pixel(2, 3, orangeBrown)
  420. @autumn_leaf_bitmaps[0].set_pixel(3, 3, brightOrange)
  421. @autumn_leaf_bitmaps[0].fill_rect(4, 3, 2, 1, paleOrange)
  422. @autumn_leaf_bitmaps[0].set_pixel(1, 4, orangeBrown)
  423. @autumn_leaf_bitmaps[0].set_pixel(2, 4, brightOrange)
  424. @autumn_leaf_bitmaps[0].set_pixel(3, 4, paleOrange)
  425. @autumn_leaf_bitmaps[0].set_pixel(1, 5, brightOrange)
  426. @autumn_leaf_bitmaps[0].set_pixel(2, 5, paleOrange)
  427. @autumn_leaf_bitmaps[0].set_pixel(0, 6, orangeBrown)
  428. @autumn_leaf_bitmaps[0].set_pixel(1, 6, paleOrange)
  429. @autumn_leaf_bitmaps[0].set_pixel(0, 7, paleOrange)

  430. # draw the 2nd of the leaf1 bitmaps
  431. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  432. @autumn_leaf_bitmaps[1].set_pixel(3, 0, brightOrange)
  433. @autumn_leaf_bitmaps[1].set_pixel(7, 0, brightOrange)
  434. @autumn_leaf_bitmaps[1].set_pixel(3, 1, orangeBrown)
  435. @autumn_leaf_bitmaps[1].set_pixel(4, 1, burntRed)
  436. @autumn_leaf_bitmaps[1].set_pixel(6, 1, brightOrange)
  437. @autumn_leaf_bitmaps[1].set_pixel(0, 2, paleOrange)
  438. @autumn_leaf_bitmaps[1].set_pixel(1, 2, brightOrange)
  439. @autumn_leaf_bitmaps[1].set_pixel(2, 2, orangeBrown)
  440. @autumn_leaf_bitmaps[1].set_pixel(3, 2, burntRed)
  441. @autumn_leaf_bitmaps[1].set_pixel(4, 2, orangeBrown)
  442. @autumn_leaf_bitmaps[1].set_pixel(5, 2, brightOrange)
  443. @autumn_leaf_bitmaps[1].fill_rect(1, 3, 3, 1, orangeBrown)
  444. @autumn_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, brightOrange)
  445. @autumn_leaf_bitmaps[1].set_pixel(6, 3, orangeBrown)
  446. @autumn_leaf_bitmaps[1].set_pixel(2, 4, burntRed)
  447. @autumn_leaf_bitmaps[1].fill_rect(3, 4, 3, 1, brightOrange)
  448. @autumn_leaf_bitmaps[1].set_pixel(6, 4, burntRed)
  449. @autumn_leaf_bitmaps[1].set_pixel(7, 4, darkBrown)
  450. @autumn_leaf_bitmaps[1].set_pixel(1, 5, orangeBrown)
  451. @autumn_leaf_bitmaps[1].fill_rect(2, 5, 2, 1, brightOrange)
  452. @autumn_leaf_bitmaps[1].set_pixel(4, 5, orangeBrown)
  453. @autumn_leaf_bitmaps[1].set_pixel(5, 5, burntRed)
  454. @autumn_leaf_bitmaps[1].fill_rect(1, 6, 2, 1, brightOrange)
  455. @autumn_leaf_bitmaps[1].fill_rect(4, 6, 2, 1, burntRed)
  456. @autumn_leaf_bitmaps[1].set_pixel(0, 7, brightOrange)
  457. @autumn_leaf_bitmaps[1].set_pixel(5, 7, darkBrown)

  458. # draw the 3rd of the leaf1 bitmaps
  459. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  460. @autumn_leaf_bitmaps[2].set_pixel(7, 1, paleOrange)
  461. @autumn_leaf_bitmaps[2].set_pixel(6, 2, paleOrange)
  462. @autumn_leaf_bitmaps[2].set_pixel(7, 2, orangeBrown)
  463. @autumn_leaf_bitmaps[2].set_pixel(5, 3, paleOrange)
  464. @autumn_leaf_bitmaps[2].set_pixel(6, 3, brightOrange)
  465. @autumn_leaf_bitmaps[2].set_pixel(4, 4, paleOrange)
  466. @autumn_leaf_bitmaps[2].set_pixel(5, 4, brightOrange)
  467. @autumn_leaf_bitmaps[2].set_pixel(6, 4, orangeBrown)
  468. @autumn_leaf_bitmaps[2].fill_rect(2, 5, 2, 1, paleOrange)
  469. @autumn_leaf_bitmaps[2].set_pixel(4, 5, brightOrange)
  470. @autumn_leaf_bitmaps[2].set_pixel(5, 5, orangeBrown)
  471. @autumn_leaf_bitmaps[2].set_pixel(1, 6, paleOrange)
  472. @autumn_leaf_bitmaps[2].fill_rect(2, 6, 2, 1, brightOrange)
  473. @autumn_leaf_bitmaps[2].set_pixel(4, 6, orangeBrown)
  474. @autumn_leaf_bitmaps[2].set_pixel(0, 7, paleOrange)
  475. @autumn_leaf_bitmaps[2].set_pixel(1, 7, brightOrange)
  476. @autumn_leaf_bitmaps[2].set_pixel(2, 7, orangeBrown)

  477. # draw the 4th of the leaf1 bitmaps
  478. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  479. @autumn_leaf_bitmaps[3].set_pixel(3, 0, brightOrange)
  480. @autumn_leaf_bitmaps[3].set_pixel(7, 0, brightOrange)
  481. @autumn_leaf_bitmaps[3].set_pixel(3, 1, orangeBrown)
  482. @autumn_leaf_bitmaps[3].set_pixel(4, 1, burntRed)
  483. @autumn_leaf_bitmaps[3].set_pixel(6, 1, brightOrange)
  484. @autumn_leaf_bitmaps[3].set_pixel(0, 2, paleOrange)
  485. @autumn_leaf_bitmaps[3].set_pixel(1, 2, brightOrange)
  486. @autumn_leaf_bitmaps[3].set_pixel(2, 2, orangeBrown)
  487. @autumn_leaf_bitmaps[3].set_pixel(3, 2, burntRed)
  488. @autumn_leaf_bitmaps[3].set_pixel(4, 2, orangeBrown)
  489. @autumn_leaf_bitmaps[3].set_pixel(5, 2, brightOrange)
  490. @autumn_leaf_bitmaps[3].fill_rect(1, 3, 3, 1, orangeBrown)
  491. @autumn_leaf_bitmaps[3].fill_rect(4, 3, 2, 1, brightOrange)
  492. @autumn_leaf_bitmaps[3].set_pixel(6, 3, orangeBrown)
  493. @autumn_leaf_bitmaps[3].set_pixel(2, 4, burntRed)
  494. @autumn_leaf_bitmaps[3].fill_rect(3, 4, 3, 1, brightOrange)
  495. @autumn_leaf_bitmaps[3].set_pixel(6, 4, burntRed)
  496. @autumn_leaf_bitmaps[3].set_pixel(7, 4, darkBrown)
  497. @autumn_leaf_bitmaps[3].set_pixel(1, 5, orangeBrown)
  498. @autumn_leaf_bitmaps[3].fill_rect(2, 5, 2, 1, brightOrange)
  499. @autumn_leaf_bitmaps[3].set_pixel(4, 5, orangeBrown)
  500. @autumn_leaf_bitmaps[3].set_pixel(5, 5, burntRed)
  501. @autumn_leaf_bitmaps[3].fill_rect(1, 6, 2, 1, brightOrange)
  502. @autumn_leaf_bitmaps[3].fill_rect(4, 6, 2, 1, burntRed)
  503. @autumn_leaf_bitmaps[3].set_pixel(0, 7, brightOrange)
  504. @autumn_leaf_bitmaps[3].set_pixel(5, 7, darkBrown)

  505. @green_leaf_bitmaps = []
  506. darkGreen = Color.new(62, 76, 31, 255)
  507. midGreen = Color.new(76, 91, 43, 255)
  508. khaki = Color.new(105, 114, 66, 255)
  509. lightGreen = Color.new(128, 136, 88, 255)
  510. mint = Color.new(146, 154, 106, 255)

  511. # 1st leaf bitmap
  512. @green_leaf_bitmaps[0] = Bitmap.new(8, 8)
  513. @green_leaf_bitmaps[0].set_pixel(1, 0, darkGreen)
  514. @green_leaf_bitmaps[0].set_pixel(1, 1, midGreen)
  515. @green_leaf_bitmaps[0].set_pixel(2, 1, darkGreen)
  516. @green_leaf_bitmaps[0].set_pixel(2, 2, khaki)
  517. @green_leaf_bitmaps[0].set_pixel(3, 2, darkGreen)
  518. @green_leaf_bitmaps[0].set_pixel(4, 2, khaki)
  519. @green_leaf_bitmaps[0].fill_rect(2, 3, 3, 1, midGreen)
  520. @green_leaf_bitmaps[0].set_pixel(5, 3, khaki)
  521. @green_leaf_bitmaps[0].fill_rect(2, 4, 2, 1, midGreen)
  522. @green_leaf_bitmaps[0].set_pixel(4, 4, darkGreen)
  523. @green_leaf_bitmaps[0].set_pixel(5, 4, lightGreen)
  524. @green_leaf_bitmaps[0].set_pixel(6, 4, khaki)
  525. @green_leaf_bitmaps[0].set_pixel(3, 5, midGreen)
  526. @green_leaf_bitmaps[0].set_pixel(4, 5, darkGreen)
  527. @green_leaf_bitmaps[0].set_pixel(5, 5, khaki)
  528. @green_leaf_bitmaps[0].set_pixel(6, 5, lightGreen)
  529. @green_leaf_bitmaps[0].set_pixel(4, 6, midGreen)
  530. @green_leaf_bitmaps[0].set_pixel(5, 6, darkGreen)
  531. @green_leaf_bitmaps[0].set_pixel(6, 6, lightGreen)
  532. @green_leaf_bitmaps[0].set_pixel(6, 7, khaki)

  533. # 2nd leaf bitmap
  534. @green_leaf_bitmaps[1] = Bitmap.new(8, 8)
  535. @green_leaf_bitmaps[1].fill_rect(1, 1, 1, 2, midGreen)
  536. @green_leaf_bitmaps[1].fill_rect(2, 2, 2, 1, khaki)
  537. @green_leaf_bitmaps[1].set_pixel(4, 2, lightGreen)
  538. @green_leaf_bitmaps[1].fill_rect(2, 3, 2, 1, darkGreen)
  539. @green_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, lightGreen)
  540. @green_leaf_bitmaps[1].set_pixel(2, 4, midGreen)
  541. @green_leaf_bitmaps[1].set_pixel(3, 4, darkGreen)
  542. @green_leaf_bitmaps[1].set_pixel(4, 4, khaki)
  543. @green_leaf_bitmaps[1].fill_rect(5, 4, 2, 1, lightGreen)
  544. @green_leaf_bitmaps[1].set_pixel(3, 5, midGreen)
  545. @green_leaf_bitmaps[1].set_pixel(4, 5, darkGreen)
  546. @green_leaf_bitmaps[1].set_pixel(5, 5, khaki)
  547. @green_leaf_bitmaps[1].set_pixel(6, 5, lightGreen)
  548. @green_leaf_bitmaps[1].set_pixel(5, 6, darkGreen)
  549. @green_leaf_bitmaps[1].fill_rect(6, 6, 2, 1, khaki)

  550. # 3rd leaf bitmap
  551. @green_leaf_bitmaps[2] = Bitmap.new(8, 8)
  552. @green_leaf_bitmaps[2].set_pixel(1, 1, darkGreen)
  553. @green_leaf_bitmaps[2].fill_rect(1, 2, 2, 1, midGreen)
  554. @green_leaf_bitmaps[2].set_pixel(2, 3, midGreen)
  555. @green_leaf_bitmaps[2].set_pixel(3, 3, darkGreen)
  556. @green_leaf_bitmaps[2].set_pixel(4, 3, midGreen)
  557. @green_leaf_bitmaps[2].fill_rect(2, 4, 2, 1, midGreen)
  558. @green_leaf_bitmaps[2].set_pixel(4, 4, darkGreen)
  559. @green_leaf_bitmaps[2].set_pixel(5, 4, lightGreen)
  560. @green_leaf_bitmaps[2].set_pixel(3, 5, midGreen)
  561. @green_leaf_bitmaps[2].set_pixel(4, 5, darkGreen)
  562. @green_leaf_bitmaps[2].fill_rect(5, 5, 2, 1, khaki)
  563. @green_leaf_bitmaps[2].fill_rect(4, 6, 2, 1, midGreen)
  564. @green_leaf_bitmaps[2].set_pixel(6, 6, lightGreen)
  565. @green_leaf_bitmaps[2].set_pixel(6, 7, khaki)

  566. # 4th leaf bitmap
  567. @green_leaf_bitmaps[3] = Bitmap.new(8, 8)
  568. @green_leaf_bitmaps[3].fill_rect(0, 3, 1, 2, darkGreen)
  569. @green_leaf_bitmaps[3].set_pixel(1, 4, midGreen)
  570. @green_leaf_bitmaps[3].set_pixel(2, 4, khaki)
  571. @green_leaf_bitmaps[3].set_pixel(3, 4, lightGreen)
  572. @green_leaf_bitmaps[3].set_pixel(4, 4, darkGreen)
  573. @green_leaf_bitmaps[3].set_pixel(7, 4, midGreen)
  574. @green_leaf_bitmaps[3].set_pixel(1, 5, darkGreen)
  575. @green_leaf_bitmaps[3].set_pixel(2, 5, midGreen)
  576. @green_leaf_bitmaps[3].set_pixel(3, 5, lightGreen)
  577. @green_leaf_bitmaps[3].set_pixel(4, 5, mint)
  578. @green_leaf_bitmaps[3].set_pixel(5, 5, lightGreen)
  579. @green_leaf_bitmaps[3].set_pixel(6, 5, khaki)
  580. @green_leaf_bitmaps[3].set_pixel(7, 5, midGreen)
  581. @green_leaf_bitmaps[3].fill_rect(2, 6, 2, 1, midGreen)
  582. @green_leaf_bitmaps[3].set_pixel(4, 6, lightGreen)
  583. @green_leaf_bitmaps[3].set_pixel(5, 6, khaki)
  584. @green_leaf_bitmaps[3].set_pixel(6, 6, midGreen)

  585. # 5th leaf bitmap
  586. @green_leaf_bitmaps[4] = Bitmap.new(8, 8)
  587. @green_leaf_bitmaps[4].set_pixel(6, 2, midGreen)
  588. @green_leaf_bitmaps[4].set_pixel(7, 2, darkGreen)
  589. @green_leaf_bitmaps[4].fill_rect(4, 3, 2, 1, midGreen)
  590. @green_leaf_bitmaps[4].set_pixel(6, 3, khaki)
  591. @green_leaf_bitmaps[4].set_pixel(2, 4, darkGreen)
  592. @green_leaf_bitmaps[4].fill_rect(3, 4, 2, 1, khaki)
  593. @green_leaf_bitmaps[4].set_pixel(5, 4, lightGreen)
  594. @green_leaf_bitmaps[4].set_pixel(6, 4, khaki)
  595. @green_leaf_bitmaps[4].set_pixel(1, 5, midGreen)
  596. @green_leaf_bitmaps[4].set_pixel(2, 5, khaki)
  597. @green_leaf_bitmaps[4].set_pixel(3, 5, lightGreen)
  598. @green_leaf_bitmaps[4].set_pixel(4, 5, mint)
  599. @green_leaf_bitmaps[4].set_pixel(5, 5, midGreen)
  600. @green_leaf_bitmaps[4].set_pixel(2, 6, darkGreen)
  601. @green_leaf_bitmaps[4].fill_rect(3, 6, 2, 1, midGreen)

  602. # 6th leaf bitmap
  603. @green_leaf_bitmaps[5] = Bitmap.new(8, 8)
  604. @green_leaf_bitmaps[5].fill_rect(6, 2, 2, 1, midGreen)
  605. @green_leaf_bitmaps[5].fill_rect(4, 3, 2, 1, midGreen)
  606. @green_leaf_bitmaps[5].set_pixel(6, 3, khaki)
  607. @green_leaf_bitmaps[5].set_pixel(3, 4, midGreen)
  608. @green_leaf_bitmaps[5].set_pixel(4, 4, khaki)
  609. @green_leaf_bitmaps[5].set_pixel(5, 4, lightGreen)
  610. @green_leaf_bitmaps[5].set_pixel(6, 4, mint)
  611. @green_leaf_bitmaps[5].set_pixel(1, 5, midGreen)
  612. @green_leaf_bitmaps[5].set_pixel(2, 5, khaki)
  613. @green_leaf_bitmaps[5].fill_rect(3, 5, 2, 1, mint)
  614. @green_leaf_bitmaps[5].set_pixel(5, 5, lightGreen)
  615. @green_leaf_bitmaps[5].set_pixel(2, 6, midGreen)
  616. @green_leaf_bitmaps[5].set_pixel(3, 6, khaki)
  617. @green_leaf_bitmaps[5].set_pixel(4, 6, lightGreen)

  618. # 7th leaf bitmap
  619. @green_leaf_bitmaps[6] = Bitmap.new(8, 8)
  620. @green_leaf_bitmaps[6].fill_rect(6, 1, 1, 2, midGreen)
  621. @green_leaf_bitmaps[6].fill_rect(4, 2, 2, 1, midGreen)
  622. @green_leaf_bitmaps[6].fill_rect(6, 2, 1, 2, darkGreen)
  623. @green_leaf_bitmaps[6].fill_rect(3, 3, 2, 1, midGreen)
  624. @green_leaf_bitmaps[6].set_pixel(5, 3, khaki)
  625. @green_leaf_bitmaps[6].set_pixel(2, 4, midGreen)
  626. @green_leaf_bitmaps[6].set_pixel(3, 4, khaki)
  627. @green_leaf_bitmaps[6].set_pixel(4, 4, lightGreen)
  628. @green_leaf_bitmaps[6].set_pixel(5, 4, midGreen)
  629. @green_leaf_bitmaps[6].set_pixel(1, 5, midGreen)
  630. @green_leaf_bitmaps[6].set_pixel(2, 5, khaki)
  631. @green_leaf_bitmaps[6].fill_rect(3, 5, 2, 1, midGreen)
  632. @green_leaf_bitmaps[6].set_pixel(1, 6, darkGreen)
  633. @green_leaf_bitmaps[6].set_pixel(2, 6, midGreen)

  634. # 8th leaf bitmap
  635. @green_leaf_bitmaps[7] = Bitmap.new(8, 8)
  636. @green_leaf_bitmaps[7].set_pixel(6, 1, midGreen)
  637. @green_leaf_bitmaps[7].fill_rect(4, 2, 3, 2, midGreen)
  638. @green_leaf_bitmaps[7].set_pixel(3, 3, darkGreen)
  639. @green_leaf_bitmaps[7].set_pixel(2, 4, darkGreen)
  640. @green_leaf_bitmaps[7].set_pixel(3, 4, midGreen)
  641. @green_leaf_bitmaps[7].fill_rect(4, 4, 2, 1, khaki)
  642. @green_leaf_bitmaps[7].set_pixel(1, 5, darkGreen)
  643. @green_leaf_bitmaps[7].set_pixel(2, 5, midGreen)
  644. @green_leaf_bitmaps[7].fill_rect(3, 5, 2, 1, lightGreen)
  645. @green_leaf_bitmaps[7].set_pixel(2, 6, midGreen)
  646. @green_leaf_bitmaps[7].set_pixel(3, 6, lightGreen)

  647. # 9th leaf bitmap
  648. @green_leaf_bitmaps[8] = Bitmap.new(8, 8)
  649. @green_leaf_bitmaps[8].fill_rect(6, 1, 1, 2, midGreen)
  650. @green_leaf_bitmaps[8].fill_rect(4, 2, 2, 1, midGreen)
  651. @green_leaf_bitmaps[8].fill_rect(6, 2, 1, 2, darkGreen)
  652. @green_leaf_bitmaps[8].fill_rect(3, 3, 2, 1, midGreen)
  653. @green_leaf_bitmaps[8].set_pixel(5, 3, khaki)
  654. @green_leaf_bitmaps[8].set_pixel(2, 4, midGreen)
  655. @green_leaf_bitmaps[8].set_pixel(3, 4, khaki)
  656. @green_leaf_bitmaps[8].set_pixel(4, 4, lightGreen)
  657. @green_leaf_bitmaps[8].set_pixel(5, 4, midGreen)
  658. @green_leaf_bitmaps[8].set_pixel(1, 5, midGreen)
  659. @green_leaf_bitmaps[8].set_pixel(2, 5, khaki)
  660. @green_leaf_bitmaps[8].fill_rect(3, 5, 2, 1, midGreen)
  661. @green_leaf_bitmaps[8].set_pixel(1, 6, darkGreen)
  662. @green_leaf_bitmaps[8].set_pixel(2, 6, midGreen)

  663. # 10th leaf bitmap
  664. @green_leaf_bitmaps[9] = Bitmap.new(8, 8)
  665. @green_leaf_bitmaps[9].fill_rect(6, 2, 2, 1, midGreen)
  666. @green_leaf_bitmaps[9].fill_rect(4, 3, 2, 1, midGreen)
  667. @green_leaf_bitmaps[9].set_pixel(6, 3, khaki)
  668. @green_leaf_bitmaps[9].set_pixel(3, 4, midGreen)
  669. @green_leaf_bitmaps[9].set_pixel(4, 4, khaki)
  670. @green_leaf_bitmaps[9].set_pixel(5, 4, lightGreen)
  671. @green_leaf_bitmaps[9].set_pixel(6, 4, mint)
  672. @green_leaf_bitmaps[9].set_pixel(1, 5, midGreen)
  673. @green_leaf_bitmaps[9].set_pixel(2, 5, khaki)
  674. @green_leaf_bitmaps[9].fill_rect(3, 5, 2, 1, mint)
  675. @green_leaf_bitmaps[9].set_pixel(5, 5, lightGreen)
  676. @green_leaf_bitmaps[9].set_pixel(2, 6, midGreen)
  677. @green_leaf_bitmaps[9].set_pixel(3, 6, khaki)
  678. @green_leaf_bitmaps[9].set_pixel(4, 6, lightGreen)

  679. # 11th leaf bitmap
  680. @green_leaf_bitmaps[10] = Bitmap.new(8, 8)
  681. @green_leaf_bitmaps[10].set_pixel(6, 2, midGreen)
  682. @green_leaf_bitmaps[10].set_pixel(7, 2, darkGreen)
  683. @green_leaf_bitmaps[10].fill_rect(4, 3, 2, 1, midGreen)
  684. @green_leaf_bitmaps[10].set_pixel(6, 3, khaki)
  685. @green_leaf_bitmaps[10].set_pixel(2, 4, darkGreen)
  686. @green_leaf_bitmaps[10].fill_rect(3, 4, 2, 1, khaki)
  687. @green_leaf_bitmaps[10].set_pixel(5, 4, lightGreen)
  688. @green_leaf_bitmaps[10].set_pixel(6, 4, khaki)
  689. @green_leaf_bitmaps[10].set_pixel(1, 5, midGreen)
  690. @green_leaf_bitmaps[10].set_pixel(2, 5, khaki)
  691. @green_leaf_bitmaps[10].set_pixel(3, 5, lightGreen)
  692. @green_leaf_bitmaps[10].set_pixel(4, 5, mint)
  693. @green_leaf_bitmaps[10].set_pixel(5, 5, midGreen)
  694. @green_leaf_bitmaps[10].set_pixel(2, 6, darkGreen)
  695. @green_leaf_bitmaps[10].fill_rect(3, 6, 2, 1, midGreen)



  696. # 12th leaf bitmap
  697. @green_leaf_bitmaps[11] = Bitmap.new(8, 8)
  698. @green_leaf_bitmaps[11].fill_rect(0, 3, 1, 2, darkGreen)
  699. @green_leaf_bitmaps[11].set_pixel(1, 4, midGreen)
  700. @green_leaf_bitmaps[11].set_pixel(2, 4, khaki)
  701. @green_leaf_bitmaps[11].set_pixel(3, 4, lightGreen)
  702. @green_leaf_bitmaps[11].set_pixel(4, 4, darkGreen)
  703. @green_leaf_bitmaps[11].set_pixel(7, 4, midGreen)
  704. @green_leaf_bitmaps[11].set_pixel(1, 5, darkGreen)
  705. @green_leaf_bitmaps[11].set_pixel(2, 5, midGreen)
  706. @green_leaf_bitmaps[11].set_pixel(3, 5, lightGreen)
  707. @green_leaf_bitmaps[11].set_pixel(4, 5, mint)
  708. @green_leaf_bitmaps[11].set_pixel(5, 5, lightGreen)
  709. @green_leaf_bitmaps[11].set_pixel(6, 5, khaki)
  710. @green_leaf_bitmaps[11].set_pixel(7, 5, midGreen)
  711. @green_leaf_bitmaps[11].fill_rect(2, 6, 2, 1, midGreen)
  712. @green_leaf_bitmaps[11].set_pixel(4, 6, lightGreen)
  713. @green_leaf_bitmaps[11].set_pixel(5, 6, khaki)
  714. @green_leaf_bitmaps[11].set_pixel(6, 6, midGreen)

  715. # 13th leaf bitmap
  716. @green_leaf_bitmaps[12] = Bitmap.new(8, 8)
  717. @green_leaf_bitmaps[12].set_pixel(1, 1, darkGreen)
  718. @green_leaf_bitmaps[12].fill_rect(1, 2, 2, 1, midGreen)
  719. @green_leaf_bitmaps[12].set_pixel(2, 3, midGreen)
  720. @green_leaf_bitmaps[12].set_pixel(3, 3, darkGreen)
  721. @green_leaf_bitmaps[12].set_pixel(4, 3, midGreen)
  722. @green_leaf_bitmaps[12].fill_rect(2, 4, 2, 1, midGreen)
  723. @green_leaf_bitmaps[12].set_pixel(4, 4, darkGreen)
  724. @green_leaf_bitmaps[12].set_pixel(5, 4, lightGreen)
  725. @green_leaf_bitmaps[12].set_pixel(3, 5, midGreen)
  726. @green_leaf_bitmaps[12].set_pixel(4, 5, darkGreen)
  727. @green_leaf_bitmaps[12].fill_rect(5, 5, 2, 1, khaki)
  728. @green_leaf_bitmaps[12].fill_rect(4, 6, 2, 1, midGreen)
  729. @green_leaf_bitmaps[12].set_pixel(6, 6, lightGreen)
  730. @green_leaf_bitmaps[12].set_pixel(6, 7, khaki)

  731. @rose_bitmaps = []
  732. brightRed = Color.new(255, 0, 0, 255)
  733. midRed = Color.new(179, 17, 17, 255)
  734. darkRed = Color.new(141, 9, 9, 255)

  735. # 1st rose petal bitmap
  736. @rose_bitmaps[0] = Bitmap.new(3, 3)
  737. @rose_bitmaps[0].fill_rect(1, 0, 2, 1, brightRed)
  738. @rose_bitmaps[0].fill_rect(0, 1, 1, 2, brightRed)
  739. @rose_bitmaps[0].fill_rect(1, 1, 2, 2, midRed)
  740. @rose_bitmaps[0].set_pixel(2, 2, darkRed)

  741. # 2nd rose petal bitmap
  742. @rose_bitmaps[1] = Bitmap.new(3, 3)
  743. @rose_bitmaps[1].set_pixel(0, 1, midRed)
  744. @rose_bitmaps[1].set_pixel(1, 1, brightRed)
  745. @rose_bitmaps[1].fill_rect(1, 2, 1, 2, midRed)

  746. @feather_bitmaps = []
  747. white = Color.new(255, 255, 255, 255)

  748. # 1st feather bitmap
  749. @feather_bitmaps[0] = Bitmap.new(3, 3)
  750. @feather_bitmaps[0].set_pixel(0, 2, white)
  751. @feather_bitmaps[0].set_pixel(1, 2, grey)
  752. @feather_bitmaps[0].set_pixel(2, 1, grey)

  753. # 2nd feather bitmap
  754. @feather_bitmaps[0] = Bitmap.new(3, 3)
  755. @feather_bitmaps[0].set_pixel(0, 0, white)
  756. @feather_bitmaps[0].set_pixel(0, 1, grey)
  757. @feather_bitmaps[0].set_pixel(1, 2, grey)

  758. # 3rd feather bitmap
  759. @feather_bitmaps[0] = Bitmap.new(3, 3)
  760. @feather_bitmaps[0].set_pixel(2, 0, white)
  761. @feather_bitmaps[0].set_pixel(1, 0, grey)
  762. @feather_bitmaps[0].set_pixel(0, 1, grey)

  763. # 4th feather bitmap
  764. @feather_bitmaps[0] = Bitmap.new(3, 3)
  765. @feather_bitmaps[0].set_pixel(2, 2, white)
  766. @feather_bitmaps[0].set_pixel(2, 1, grey)
  767. @feather_bitmaps[0].set_pixel(1, 0, grey)

  768. @blood_rain_bitmap = Bitmap.new(7, 56)
  769. for i in 0..6
  770. @blood_rain_bitmap.fill_rect(6-i, i*8, 1, 8, darkRed)
  771. end

  772. @sparkle_bitmaps = []

  773. lightBlue = Color.new(181, 244, 255, 255)
  774. midBlue = Color.new(126, 197, 235, 255)
  775. darkBlue = Color.new(77, 136, 225, 255)

  776. # 1st sparkle bitmap
  777. @sparkle_bitmaps[0] = Bitmap.new(7, 7)
  778. @sparkle_bitmaps[0].set_pixel(3, 3, darkBlue)

  779. # 2nd sparkle bitmap
  780. @sparkle_bitmaps[1] = Bitmap.new(7, 7)
  781. @sparkle_bitmaps[1].fill_rect(3, 2, 1, 3, darkBlue)
  782. @sparkle_bitmaps[1].fill_rect(2, 3, 3, 1, darkBlue)
  783. @sparkle_bitmaps[1].set_pixel(3, 3, midBlue)

  784. # 3rd sparkle bitmap
  785. @sparkle_bitmaps[2] = Bitmap.new(7, 7)
  786. @sparkle_bitmaps[2].set_pixel(1, 1, darkBlue)
  787. @sparkle_bitmaps[2].set_pixel(5, 1, darkBlue)
  788. @sparkle_bitmaps[2].set_pixel(2, 2, midBlue)
  789. @sparkle_bitmaps[2].set_pixel(4, 2, midBlue)
  790. @sparkle_bitmaps[2].set_pixel(3, 3, lightBlue)
  791. @sparkle_bitmaps[2].set_pixel(2, 4, midBlue)
  792. @sparkle_bitmaps[2].set_pixel(4, 4, midBlue)
  793. @sparkle_bitmaps[2].set_pixel(1, 5, darkBlue)
  794. @sparkle_bitmaps[2].set_pixel(5, 5, darkBlue)

  795. # 4th sparkle bitmap
  796. @sparkle_bitmaps[3] = Bitmap.new(7, 7)
  797. @sparkle_bitmaps[3].fill_rect(3, 1, 1, 5, darkBlue)
  798. @sparkle_bitmaps[3].fill_rect(1, 3, 5, 1, darkBlue)
  799. @sparkle_bitmaps[3].fill_rect(3, 2, 1, 3, midBlue)
  800. @sparkle_bitmaps[3].fill_rect(2, 3, 3, 1, midBlue)
  801. @sparkle_bitmaps[3].set_pixel(3, 3, lightBlue)

  802. # 5th sparkle bitmap
  803. @sparkle_bitmaps[4] = Bitmap.new(7, 7)
  804. @sparkle_bitmaps[4].fill_rect(2, 2, 3, 3, midBlue)
  805. @sparkle_bitmaps[4].fill_rect(3, 2, 1, 3, darkBlue)
  806. @sparkle_bitmaps[4].fill_rect(2, 3, 3, 1, darkBlue)
  807. @sparkle_bitmaps[4].set_pixel(3, 3, lightBlue)
  808. @sparkle_bitmaps[4].set_pixel(1, 1, darkBlue)
  809. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
  810. @sparkle_bitmaps[4].set_pixel(1, 5, darkBlue)
  811. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)

  812. # 6th sparkle bitmap
  813. @sparkle_bitmaps[5] = Bitmap.new(7, 7)
  814. @sparkle_bitmaps[5].fill_rect(2, 1, 3, 5, darkBlue)
  815. @sparkle_bitmaps[5].fill_rect(1, 2, 5, 3, darkBlue)
  816. @sparkle_bitmaps[5].fill_rect(2, 2, 3, 3, midBlue)
  817. @sparkle_bitmaps[5].fill_rect(3, 1, 1, 5, midBlue)
  818. @sparkle_bitmaps[5].fill_rect(1, 3, 5, 1, midBlue)
  819. @sparkle_bitmaps[5].fill_rect(3, 2, 1, 3, lightBlue)
  820. @sparkle_bitmaps[5].fill_rect(2, 3, 3, 1, lightBlue)
  821. @sparkle_bitmaps[5].set_pixel(3, 3, white)

  822. # 7th sparkle bitmap
  823. @sparkle_bitmaps[6] = Bitmap.new(7, 7)
  824. @sparkle_bitmaps[6].fill_rect(2, 1, 3, 5, midBlue)
  825. @sparkle_bitmaps[6].fill_rect(1, 2, 5, 3, midBlue)
  826. @sparkle_bitmaps[6].fill_rect(3, 0, 1, 7, darkBlue)
  827. @sparkle_bitmaps[6].fill_rect(0, 3, 7, 1, darkBlue)
  828. @sparkle_bitmaps[6].fill_rect(2, 2, 3, 3, lightBlue)
  829. @sparkle_bitmaps[6].fill_rect(3, 2, 1, 3, midBlue)
  830. @sparkle_bitmaps[6].fill_rect(2, 3, 3, 1, midBlue)
  831. @sparkle_bitmaps[6].set_pixel(3, 3, white)

  832. @user_bitmaps = []
  833. update_user_defined
  834. end

  835. def update_user_defined
  836. for image in @user_bitmaps
  837. image.dispose
  838. end

  839. #user-defined bitmaps
  840. for name in $WEATHER_IMAGES
  841. @user_bitmaps.push(RPG::Cache.picture(name))
  842. end
  843. for sprite in @sprites
  844. sprite.bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  845. end
  846. end

  847. attr_reader :type
  848. attr_reader :max
  849. attr_reader :ox
  850. attr_reader :oy
  851. end
  852. end



复制代码
队员跟随
  1. #===================================================================
  2. # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
  3. #===================================================================
  4. # ————————————————————————————————————
  5. # ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
  6. # by fukuyama
  7. #
  8. # Train_Actor
  9. #
  10. # [email protected]
  11. # http://web.archive.org/web/20080410051340/http://www4.big.or.jp/~fukuyama/rgss/Train_Actor.txt
  12. #
  13. module Train_Actor
  14. #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
  15. #开关打开,跟随的人物就消失了(其实只是变成透明而已)
  16. TRANSPARENT_SWITCH = false
  17. TRANSPARENT_SWITCHES_INDEX = 20
  18. #举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。
  19. #跟随人数的最大数目,可以更改为2、3什么的。
  20. TRAIN_ACTOR_SIZE_MAX = 5
  21. # 定数
  22. #Input::DOWN = 2
  23. #Input::LEFT = 4
  24. #Input::RIGHT = 6
  25. #Input::UP = 6
  26. DOWN_LEFT = 1
  27. DOWN_RIGHT = 3
  28. UP_LEFT = 7
  29. UP_RIGHT = 9
  30. JUMP = 5
  31. class Game_Party_Actor < Game_Character
  32. def initialize
  33. super()
  34. @through = true
  35. end
  36. def setup(actor)
  37. # キャラクターのファイル名と色相を設定
  38. if actor != nil
  39. @character_name = actor.character_name
  40. @character_hue = actor.character_hue
  41. @tempneme = actor.name
  42. else
  43. @character_name = ""
  44. @character_hue = 0
  45. @tempneme = ""
  46. end
  47. # 不透明度と合成方法を初期化
  48. @opacity = 255
  49. @blend_type = 0
  50. end
  51. def screen_z(height = 0)
  52. if $game_player.x == @x and $game_player.y == @y
  53. return $game_player.screen_z(height) - 1
  54. end
  55. super(height)
  56. end
  57. def name
  58. return @tempneme
  59. end
  60. #--------------------------------------------------------------------------
  61. # ● 下に移動
  62. # turn_enabled : その場での向き変更を許可するフラグ
  63. #--------------------------------------------------------------------------
  64. def move_down(turn_enabled = true)
  65. # 下を向く
  66. if turn_enabled
  67. turn_down
  68. end
  69. # 通行可能な場合
  70. if passable?(@x, @y, Input::DOWN)
  71. # 下を向く
  72. turn_down
  73. # 座標を更新
  74. @y += 1
  75. end
  76. end
  77. #--------------------------------------------------------------------------
  78. # ● 左に移動
  79. # turn_enabled : その場での向き変更を許可するフラグ
  80. #--------------------------------------------------------------------------
  81. def move_left(turn_enabled = true)
  82. # 左を向く
  83. if turn_enabled
  84. turn_left
  85. end
  86. # 通行可能な場合
  87. if passable?(@x, @y, Input::LEFT)
  88. # 左を向く
  89. turn_left
  90. # 座標を更新
  91. @x -= 1
  92. end
  93. end
  94. #--------------------------------------------------------------------------
  95. # ● 右に移動
  96. # turn_enabled : その場での向き変更を許可するフラグ
  97. #--------------------------------------------------------------------------
  98. def move_right(turn_enabled = true)
  99. # 右を向く
  100. if turn_enabled
  101. turn_right
  102. end
  103. # 通行可能な場合
  104. if passable?(@x, @y, Input::RIGHT)
  105. # 右を向く
  106. turn_right
  107. # 座標を更新
  108. @x += 1
  109. end
  110. end
  111. #--------------------------------------------------------------------------
  112. # ● 上に移動
  113. # turn_enabled : その場での向き変更を許可するフラグ
  114. #--------------------------------------------------------------------------
  115. def move_up(turn_enabled = true)
  116. # 上を向く
  117. if turn_enabled
  118. turn_up
  119. end
  120. # 通行可能な場合
  121. if passable?(@x, @y, Input::UP)
  122. # 上を向く
  123. turn_up
  124. # 座標を更新
  125. @y -= 1
  126. end
  127. end
  128. #--------------------------------------------------------------------------
  129. # ● 左下に移動
  130. #--------------------------------------------------------------------------
  131. def move_lower_left
  132. # 向き固定でない場合
  133. unless @direction_fix
  134. # 右向きだった場合は左を、上向きだった場合は下を向く
  135. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
  136. end
  137. # 下→左、左→下 のどちらかのコースが通行可能な場合
  138. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  139. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  140. # 座標を更新
  141. @x -= 1
  142. @y += 1
  143. end
  144. end
  145. #--------------------------------------------------------------------------
  146. # ● 右下に移動
  147. #--------------------------------------------------------------------------
  148. def move_lower_right
  149. # 向き固定でない場合
  150. unless @direction_fix
  151. # 左向きだった場合は右を、上向きだった場合は下を向く
  152. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
  153. end
  154. # 下→右、右→下 のどちらかのコースが通行可能な場合
  155. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  156. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  157. # 座標を更新
  158. @x += 1
  159. @y += 1
  160. end
  161. end
  162. #--------------------------------------------------------------------------
  163. # ● 左上に移動
  164. #--------------------------------------------------------------------------
  165. def move_upper_left
  166. # 向き固定でない場合
  167. unless @direction_fix
  168. # 右向きだった場合は左を、下向きだった場合は上を向く
  169. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
  170. end
  171. # 上→左、左→上 のどちらかのコースが通行可能な場合
  172. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  173. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  174. # 座標を更新
  175. @x -= 1
  176. @y -= 1
  177. end
  178. end
  179. #--------------------------------------------------------------------------
  180. # ● 右上に移動
  181. #--------------------------------------------------------------------------
  182. def move_upper_right
  183. # 向き固定でない場合
  184. unless @direction_fix
  185. # 左向きだった場合は右を、下向きだった場合は上を向く
  186. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
  187. end
  188. # 上→右、右→上 のどちらかのコースが通行可能な場合
  189. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  190. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  191. # 座標を更新
  192. @x += 1
  193. @y -= 1
  194. end
  195. end
  196. attr_writer :move_speed
  197. attr_writer :step_anime
  198. end
  199. module Spriteset_Map_Module
  200. def setup_actor_character_sprites?
  201. return @setup_actor_character_sprites_flag != nil
  202. end
  203. def setup_actor_character_sprites(characters)
  204. if !setup_actor_character_sprites?
  205. index_game_player = 0
  206. @character_sprites.each_index do |i|
  207. if @character_sprites[i].character.instance_of?(Game_Player)
  208. index_game_player = i
  209. break
  210. end
  211. end
  212. for character in characters.reverse
  213. @character_sprites.unshift(
  214. Sprite_Character.new(@viewport1, character)
  215. )
  216. end
  217. @setup_actor_character_sprites_flag = true
  218. end
  219. end
  220. end
  221. module Scene_Map_Module
  222. def setup_actor_character_sprites(characters)
  223. @spriteset.setup_actor_character_sprites(characters)
  224. end
  225. end
  226. module Game_Party_Module
  227. def set_transparent_actors(transparent)
  228. @transparent = transparent
  229. end
  230. def setup_actor_character_sprites
  231. if @characters == nil
  232. @characters = []
  233. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  234. @characters.push(Game_Party_Actor.new)
  235. end
  236. end
  237. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  238. @characters[i - 1].setup(actors[i])
  239. end
  240. if $scene.class.method_defined?('setup_actor_character_sprites')
  241. $scene.setup_actor_character_sprites(@characters)
  242. end
  243. end
  244. def update_party_actors
  245. setup_actor_character_sprites
  246. transparent = $game_player.transparent
  247. if transparent == false
  248. if TRANSPARENT_SWITCH
  249. transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
  250. end
  251. end
  252. for character in @characters
  253. character.transparent = transparent
  254. character.move_speed = $game_player.move_speed
  255. character.step_anime = $game_player.step_anime
  256. character.update
  257. end
  258. end
  259. def moveto_party_actors( x, y )
  260. setup_actor_character_sprites
  261. for character in @characters
  262. character.moveto( x, y )
  263. end
  264. if @move_list == nil
  265. @move_list = []
  266. end
  267. move_list_setup
  268. end
  269. def move_party_actors
  270. if @move_list == nil
  271. @move_list = []
  272. move_list_setup
  273. end
  274. @move_list.each_index do |i|
  275. if @characters[i] != nil
  276. case @move_list[i].type
  277. when Input::DOWN
  278. @characters[i].move_down(@move_list[i].args[0])
  279. when Input::LEFT
  280. @characters[i].move_left(@move_list[i].args[0])
  281. when Input::RIGHT
  282. @characters[i].move_right(@move_list[i].args[0])
  283. when Input::UP
  284. @characters[i].move_up(@move_list[i].args[0])
  285. when DOWN_LEFT
  286. @characters[i].move_lower_left
  287. when DOWN_RIGHT
  288. @characters[i].move_lower_right
  289. when UP_LEFT
  290. @characters[i].move_upper_left
  291. when UP_RIGHT
  292. @characters[i].move_upper_right
  293. when JUMP
  294. @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
  295. end
  296. end
  297. end
  298. end
  299. class Move_List_Element
  300. def initialize(type,args)
  301. @type = type
  302. @args = args
  303. end
  304. def type() return @type end
  305. def args() return @args end
  306. end
  307. def move_list_setup
  308. for i in 0 .. TRAIN_ACTOR_SIZE_MAX
  309. @move_list[i] = nil
  310. end
  311. end
  312. def add_move_list(type,*args)
  313. @move_list.unshift(Move_List_Element.new(type,args)).pop
  314. end
  315. def move_down_party_actors(turn_enabled = true)
  316. move_party_actors
  317. add_move_list(Input::DOWN,turn_enabled)
  318. end
  319. def move_left_party_actors(turn_enabled = true)
  320. move_party_actors
  321. add_move_list(Input::LEFT,turn_enabled)
  322. end
  323. def move_right_party_actors(turn_enabled = true)
  324. move_party_actors
  325. add_move_list(Input::RIGHT,turn_enabled)
  326. end
  327. def move_up_party_actors(turn_enabled = true)
  328. move_party_actors
  329. add_move_list(Input::UP,turn_enabled)
  330. end
  331. def move_lower_left_party_actors
  332. move_party_actors
  333. add_move_list(DOWN_LEFT)
  334. end
  335. def move_lower_right_party_actors
  336. move_party_actors
  337. add_move_list(DOWN_RIGHT)
  338. end
  339. def move_upper_left_party_actors
  340. move_party_actors
  341. add_move_list(UP_LEFT)
  342. end
  343. def move_upper_right_party_actors
  344. move_party_actors
  345. add_move_list(UP_RIGHT)
  346. end
  347. def jump_party_actors(x_plus, y_plus)
  348. move_party_actors
  349. add_move_list(JUMP,x_plus, y_plus)
  350. end
  351. end
  352. module Game_Player_Module
  353. def update
  354. $game_party.update_party_actors
  355. super
  356. end
  357. def moveto( x, y )
  358. $game_party.moveto_party_actors( x, y )
  359. super( x, y )
  360. end
  361. def move_down(turn_enabled = true)
  362. if passable?(@x, @y, Input::DOWN)
  363. $game_party.move_down_party_actors(turn_enabled)
  364. end
  365. super(turn_enabled)
  366. end
  367. def move_left(turn_enabled = true)
  368. if passable?(@x, @y, Input::LEFT)
  369. $game_party.move_left_party_actors(turn_enabled)
  370. end
  371. super(turn_enabled)
  372. end
  373. def move_right(turn_enabled = true)
  374. if passable?(@x, @y, Input::RIGHT)
  375. $game_party.move_right_party_actors(turn_enabled)
  376. end
  377. super(turn_enabled)
  378. end
  379. def move_up(turn_enabled = true)
  380. if passable?(@x, @y, Input::UP)
  381. $game_party.move_up_party_actors(turn_enabled)
  382. end
  383. super(turn_enabled)
  384. end
  385. def move_lower_left
  386. # 下→左、左→下 のどちらかのコースが通行可能な場合
  387. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  388. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  389. $game_party.move_lower_left_party_actors
  390. end
  391. super
  392. end
  393. def move_lower_right
  394. # 下→右、右→下 のどちらかのコースが通行可能な場合
  395. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  396. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  397. $game_party.move_lower_right_party_actors
  398. end
  399. super
  400. end
  401. def move_upper_left
  402. # 上→左、左→上 のどちらかのコースが通行可能な場合
  403. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  404. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  405. $game_party.move_upper_left_party_actors
  406. end
  407. super
  408. end
  409. def move_upper_right
  410. # 上→右、右→上 のどちらかのコースが通行可能な場合
  411. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  412. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  413. $game_party.move_upper_right_party_actors
  414. end
  415. super
  416. end
  417. def jump(x_plus, y_plus)
  418. # 新しい座標を計算
  419. new_x = @x + x_plus
  420. new_y = @y + y_plus
  421. # 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
  422. if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  423. $game_party.jump_party_actors(x_plus, y_plus)
  424. end
  425. super(x_plus, y_plus)
  426. end
  427. attr_reader :move_speed
  428. attr_reader :step_anime
  429. end
  430. end # module Train_Actor
  431. class Game_Party
  432. include Train_Actor::Game_Party_Module
  433. end
  434. class Game_Player
  435. include Train_Actor::Game_Player_Module
  436. end
  437. class Spriteset_Map
  438. include Train_Actor::Spriteset_Map_Module
  439. end
  440. class Scene_Map
  441. include Train_Actor::Scene_Map_Module
  442. end
  443. #==================================================================
  444. # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
  445. #==================================================================
复制代码
顺便 @弗雷德      。。。。  

点评

脚本好多url。。。想办法改吧  发表于 2013-9-19 11:14
我之前要整合的脚本找的,貌似原版的就是这样、、、  发表于 2013-9-14 23:03
脚本的排版好差。。。  发表于 2013-9-14 22:48

评分

参与人数 1星屑 +75 收起 理由
myownroc + 75 认可答案

查看全部评分


   
【RMXP共享】50个脚本整合的系统
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
285
在线时间
2 小时
注册时间
2013-9-14
帖子
4
3
 楼主| 发表于 2013-9-14 21:37:48 | 只看该作者
{:2_253:}      = = 队友间 跟的太近 用大素材的时候会导致前后重叠  然后看起来时两三个落成一摞的像毛毛虫一样的东西所以 求把他们分开  Ps:如果缩小素材 就会导致比例失衡  导致更加奇怪的情况

评分

参与人数 1星屑 -20 收起 理由
myownroc -20 连帖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
285
在线时间
2 小时
注册时间
2013-9-14
帖子
4
2
 楼主| 发表于 2013-9-14 21:15:28 | 只看该作者
{:2_276:}附加 一个 求问 队友跟随怎么弄  就是 每个人和前一个人间隔一个空格
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 19:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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