Le seul script dont j´ai connaissance, faisant mention d´une ondulation est celui-ci :
class Image_onde_xy
attr_accessor :x
attr_accessor:y
attr_accessor :op
attr_accessor:ampl
attr_accessor:puls
attr_accessor:angle
attr_accessor:blend
attr_accessor:img, :va ,:t
def initialize(x,y,nom,ampl=40,puls=4,pas=3,blend=0)
@t=0
@pas=pas
@ampl=ampl
@puls=puls
@op=255
@angle=0
@blend=blend
@va=0
@x=x
@y=y
@nom=nom
if nom .is_a?(String)
@bitsav = RPG::Cache.picture(@nom)
@img=Sprite.new
@img.bitmap=RPG::Cache.picture(@nom)
else
@bitsav = nom
@img=Sprite.new
@img.bitmap=nom
end
@img.blend_type=@blend
@img.opacity=0
super()
maj
end
def dispose
@img.bitmap.dispose
end
def maj
@t+=1
- @angle+=@va
- @img.angle=@angle
@img.opacity=@op
if @nom .is_a?(String)
@bitsav = RPG::Cache.picture(@nom)
@img.bitmap=RPG::Cache.picture(@nom)
else
@bitsav = @nom
@img.bitmap=@nom
end
@img.x =@x
@img.y =@y
@img.z=100
- @img.bitmap=RPG::Cache.picture(@nom)
if @nom .is_a?(String)
@img.bitmap=RPG::Cache.picture(@nom)
else
@img.bitmap=@nom
end
@img.ox = @img.bitmap.width / 2
@img.oy = @img.bitmap.height / 2
@img.z=55
w=@img.bitmap.width
h=@img.bitmap.height
pas=@pas
ampl=@ampl
puls=@puls
puls=puls.to_f
pas=pas.to_f
rect=[]
max=(w/pas)
for i in 0..max
rect[i]=Rect.new(i*pas,0, pas,h)
end
@img.bitmap=Bitmap.new(w,h+2*ampl)
@img.y-=ampl
for i in 0..max
@img.bitmap.blt(i*pas,ampl*(1+Math.sin((@t-i)/(pul
s*pas))),@bitsav, rect[i])
end
@bitsav=@img.bitmap
w=@img.bitmap.width
h=@img.bitmap.height
rect=[]
max=(h/pas)
for i in 0..max
rect[i]=Rect.new(0,i*pas, w, pas)
end
@img.bitmap=Bitmap.new(w+2*ampl,h)
@img.x-=ampl
for i in 0..max
@img.bitmap.blt(ampl*(1+Math.sin((@t-i)/(puls*pas)
)),i*pas,@bitsav, rect[i])
end
end
end
$imgonde=Image_onde_xy.new(position_x,position_y,"
nom de l´image sans l´extension mais entre guillemets")
reste un truc à faire: mettre à jour l´image chaque seconde.
if $imgonde.is_a?(Image_onde_x) or $imgonde.is_a?(Image_onde_y) or $imgonde.is_a?(Image_onde_xy)
$imgonde.maj
end
end
Soit vous mettez ça dans un event en processus parallèle sur votre carte, soit dans Scene_map, dans la fonction update, juste en dessous du "loop do".
Lien :