Voici un script que j'ai trouvé, il permet de faire tombé des pétales de fleur durant l'écran titre.
Auteur= Sineria
Installation=
Pour commencer voici l'image qui permettra de faire les pétales:
Cette image vous devrez le nommé "pétale".
Dans le script Scene_Title inserez se code à la ligne 36:
- Code:
-
petal_number
A la ligne 69 (avant "loop do") coller se code:
- Code:
-
@switch_petale = false
@switch_petale1 = true
@switch_petale2 = false
@switch_petale3 = true
@switch_petale4 = true
@switch_petale5 = true
@switch_petale6 = false
@switch_petale7 = true
@switch_petale8 = false
@switch_petale9 = true
@switch_petale10 = false
@switch_petale11 = false
Puis ajoutez le code si dessus après @sprite.dispose vers la ligne 100 :
- Code:
-
@petale.dispose
@petale1.dispose
@petale2.dispose
@petale3.dispose
@petale4.dispose
@petale5.dispose
@petale6.dispose
@petale7.dispose
@petale8.dispose
@petale9.dispose
@petale10.dispose
@petale11.dispose
Metez ça après def update :
- Code:
-
move_petals
Créez un nouveau script après Scene_Title et nommé le comme vous voulez et coller se code:
- Code:
-
class Scene_Title
#---------------------------------------------------------------
def petal_number
@petale = Sprite.new
@petale.bitmap = RPG::Cache.picture("pétale")
@petale.x = 200
@petale.y = 200
@first_petale_x = @petale.x
@petale1 = Sprite.new
@petale1.bitmap = RPG::Cache.picture("pétale")
@petale1.x = 312
@petale1.y = 0
@first_petale1_x = @petale1.x
@petale2 = Sprite.new
@petale2.bitmap = RPG::Cache.picture("pétale")
@petale2.x = 21
@petale2.y = 186
@first_petale2_x = @petale2.x
@petale3 = Sprite.new
@petale3.bitmap = RPG::Cache.picture("pétale")
@petale3.x = 600
@petale3.y = 62
@first_petale3_x = @petale3.x
@petale4 = Sprite.new
@petale4.bitmap = RPG::Cache.picture("pétale")
@petale4.x = 400
@petale4.y = 350
@first_petale4_x = @petale4.x
@petale5 = Sprite.new
@petale5.bitmap = RPG::Cache.picture("pétale")
@petale5.x = 532
@petale5.y = 400
@first_petale5_x = @petale5.x
@petale6 = Sprite.new
@petale6.bitmap = RPG::Cache.picture("pétale")
@petale6.x = 296
@petale6.y = 290
@first_petale6_x = @petale6.x
@petale7 = Sprite.new
@petale7.bitmap = RPG::Cache.picture("pétale")
@petale7.x = 50
@petale7.y = 356
@first_petale7_x = @petale7.x
@petale8 = Sprite.new
@petale8.bitmap = RPG::Cache.picture("pétale")
@petale8.x = 490
@petale8.y = 142
@first_petale8_x = @petale8.x
@petale9 = Sprite.new
@petale9.bitmap = RPG::Cache.picture("pétale")
@petale9.x = 96
@petale9.y = 240
@first_petale9_x = @petale9.x
@petale10 = Sprite.new
@petale10.bitmap = RPG::Cache.picture("pétale")
@petale10.x = 321
@petale10.y = - 240
@first_petale10_x = @petale10.x
@petale11 = Sprite.new
@petale11.bitmap = RPG::Cache.picture("pétale")
@petale11.x = 120
@petale6.y = 240
@first_petale11_x = @petale11.x
end
#---------------------------------------------------------------
def move_petals
#-----
@petale.y += 1
if @petale.y == 480
@petale.y = 0
return @petale.y += 1
end
if @petale.x <= @first_petale_x + 29 and @switch_petale == false
@petale.x += 1
if @petale.x == @first_petale_x + 30
@petale.x -=1
@switch_petale = true
end
end
if @petale.x <= @first_petale_x + 29 and @switch_petale == true
@petale.x -= 1
if @petale.x == @first_petale_x - 29
@switch_petale = false
end
end
#------
@petale1.y += 1
if @petale1.y == 480
@petale1.y = 0
return @petale1.y += 1
end
if @petale1.x <= @first_petale1_x + 29 and @switch_petale1 == false
@petale1.x += 1
if @petale1.x == @first_petale1_x + 30
@petale1.x -=1
@switch_petale1 = true
end
end
if @petale1.x <= @first_petale1_x + 29 and @switch_petale1 == true
@petale1.x -= 1
if @petale1.x == @first_petale1_x - 29
@switch_petale1 = false
end
end
#------
@petale2.y += 1
if @petale2.y == 480
@petale2.y = 0
return @petale2.y += 1
end
if @petale2.x <= @first_petale2_x + 29 and @switch_petale2 == false
@petale2.x += 1
if @petale2.x == @first_petale2_x + 30
@petale2.x -=1
@switch_petale2 = true
end
end
if @petale2.x <= @first_petale2_x + 29 and @switch_petale2 == true
@petale2.x -= 1
if @petale2.x == @first_petale2_x - 29
@switch_petale2 = false
end
end
#------
@petale3.y += 1
if @petale3.y == 480
@petale3.y = 0
return @petale3.y += 1
end
if @petale3.x <= @first_petale3_x + 29 and @switch_petale3 == false
@petale3.x += 1
if @petale3.x == @first_petale3_x + 30
@petale3.x -=1
@switch_petale3 = true
end
end
if @petale3.x <= @first_petale3_x + 29 and @switch_petale3 == true
@petale3.x -= 1
if @petale3.x == @first_petale3_x - 29
@switch_petale3 = false
end
end
#------
@petale4.y += 1
if @petale4.y == 480
@petale4.y = 0
return @petale4.y += 1
end
if @petale4.x <= @first_petale4_x + 29 and @switch_petale4 == false
@petale4.x += 1
if @petale4.x == @first_petale4_x + 30
@petale4.x -=1
@switch_petale4 = true
end
end
if @petale4.x <= @first_petale4_x + 29 and @switch_petale4 == true
@petale4.x -= 1
if @petale4.x == @first_petale4_x - 29
@switch_petale4 = false
end
end
#------
@petale5.y += 1
if @petale5.y == 480
@petale5.y = 0
return @petale5.y += 1
end
if @petale5.x <= @first_petale5_x + 29 and @switch_petale5 == false
@petale5.x += 1
if @petale5.x == @first_petale5_x + 30
@petale5.x -=1
@switch_petale5 = true
end
end
if @petale5.x <= @first_petale5_x + 29 and @switch_petale5 == true
@petale5.x -= 1
if @petale5.x == @first_petale5_x - 29
@switch_petale5 = false
end
end
#------
@petale6.y += 1
if @petale6.y == 480
@petale6.y = 0
return @petale6.y += 1
end
if @petale6.x <= @first_petale6_x + 29 and @switch_petale6 == false
@petale6.x += 1
if @petale6.x == @first_petale6_x + 30
@petale6.x -=1
@switch_petale6 = true
end
end
if @petale6.x <= @first_petale6_x + 29 and @switch_petale6 == true
@petale6.x -= 1
if @petale6.x == @first_petale6_x - 29
@switch_petale6 = false
end
end
#------
@petale7.y += 1
if @petale7.y == 480
@petale7.y = 0
return @petale7.y += 1
end
if @petale7.x <= @first_petale7_x + 29 and @switch_petale7 == false
@petale7.x += 1
if @petale7.x == @first_petale7_x + 30
@petale7.x -=1
@switch_petale7 = true
end
end
if @petale7.x <= @first_petale7_x + 29 and @switch_petale7 == true
@petale7.x -= 1
if @petale7.x == @first_petale7_x - 29
@switch_petale7 = false
end
end
#------
@petale8.y += 1
if @petale8.y == 480
@petale8.y = 0
return @petale8.y += 1
end
if @petale8.x <= @first_petale8_x + 29 and @switch_petale8 == false
@petale8.x += 1
if @petale8.x == @first_petale8_x + 30
@petale8.x -=1
@switch_petale8 = true
end
end
if @petale8.x <= @first_petale8_x + 29 and @switch_petale8 == true
@petale8.x -= 1
if @petale8.x == @first_petale8_x - 29
@switch_petale8 = false
end
end
#------
@petale9.y += 1
if @petale9.y == 480
@petale9.y = 0
return @petale9.y += 1
end
if @petale9.x <= @first_petale9_x + 29 and @switch_petale9 == false
@petale9.x += 1
if @petale9.x == @first_petale9_x + 30
@petale9.x -=1
@switch_petale9 = true
end
end
if @petale9.x <= @first_petale9_x + 29 and @switch_petale9 == true
@petale9.x -= 1
if @petale9.x == @first_petale9_x - 29
@switch_petale9 = false
end
end
#------
@petale10.y += 1
if @petale10.y == 480
@petale10.y = 0
return @petale10.y += 1
end
if @petale10.x <= @first_petale10_x + 29 and @switch_petale10 == false
@petale10.x += 1
if @petale10.x == @first_petale10_x + 30
@petale10.x -=1
@switch_petale10 = true
end
end
if @petale10.x <= @first_petale10_x + 29 and @switch_petale10 == true
@petale10.x -= 1
if @petale10.x == @first_petale10_x - 29
@switch_petale10 = false
end
end
#------
@petale11.y += 1
if @petale11.y == 480
@petale11.y = 0
return @petale11.y += 1
end
if @petale11.x <= @first_petale11_x + 29 and @switch_petale11 == false
@petale11.x += 1
if @petale11.x == @first_petale11_x + 30
@petale11.x -=1
@switch_petale11 = true
end
end
if @petale11.x <= @first_petale11_x + 29 and @switch_petale11 == true
@petale11.x -= 1
if @petale11.x == @first_petale11_x - 29
@switch_petale11 = false
end
end
end
end
Sceen:
Voilas c'est un bon script^^