12-31-2005, 01:00 PM
Openning door like Resident Evil
Berith
Dec 31 2005
i've made this for people who make Resident evil fan game
this script work for the door only because if you alot door and scripting all animation will be boring.
it's just required 4 picture to put in game folder picture
door = 1 closed
door = 2 open a little
door = 3 open at middle
door = 4 open totally
you can use your own picture instead.
Door picture
see under the code for people who want customize it
to call it
call script:
it's a small code to show the picture if i want to change it for an other door like Hall gate
@hallgate_0 = Sprite.new
@hallgate.bitmap = RPG::Cache.picture("hallgate")
Graphics.transition(35)
Graphics.freeze
@hallgate.dispose
however use a space between each easy viewing
for other picture just add 1 like Hallgate1,2,3......and you can add more picture
just add this bloc
and add the sprite dispose under the last dispose.
@yourdoorname.dispose
hope this can help you
Berith
Dec 31 2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
i've made this for people who make Resident evil fan game
this script work for the door only because if you alot door and scripting all animation will be boring.
it's just required 4 picture to put in game folder picture
door = 1 closed
door = 2 open a little
door = 3 open at middle
door = 4 open totally
you can use your own picture instead.
Door picture
see under the code for people who want customize it
to call it
call script:
Code:
$scene=Scene_Door.new
Code:
#=========================================================
# openning door like Resident evil
# script by berith 31/12/2005
# ajust Graphic.transition for the time of each picture
# i have done this because it's easy and for people who don't spend time.
# Thank for black_demon for fixing it
#=========================================================
class Scene_Door
def intialize
super ()
#auto_start off
self.active = false
end
#=========================================================
#setting image
#=========================================================
def main
@wait = 50
@door_0 = Sprite.new
@door_0.bitmap = RPG::Cache.picture("door")
Graphics.transition(35)
Graphics.freeze
@door_0.dispose
@door_1 = Sprite.new
@door_1.bitmap = RPG::Cache.picture("door1")
Graphics.transition(35)
Graphics.freeze
@door_1.dispose
@door_2 = Sprite.new
@door_2.bitmap = RPG::Cache.picture("door2")
Graphics.transition(35)
Graphics.freeze
@door_2.dispose
@door_3= Sprite.new
@door_3.bitmap = RPG::Cache.picture("door3")
Graphics.transition(35)
Graphics.freeze
@door_3.dispose
#graphic freeze and restore the map
Graphics.transition
loop do
Graphics.update
Input.update
$scene = Scene_Map.new
break
end
Graphics.freeze
@door_0.dispose
@door_1.dispose
@door_2.dispose
@door_3.dispose
end
end
it's a small code to show the picture if i want to change it for an other door like Hall gate
@hallgate_0 = Sprite.new
@hallgate.bitmap = RPG::Cache.picture("hallgate")
Graphics.transition(35)
Graphics.freeze
@hallgate.dispose
however use a space between each easy viewing
for other picture just add 1 like Hallgate1,2,3......and you can add more picture
just add this bloc
Code:
@door= Sprite.new
@door.bitmap = RPG::Cache.picture("door")
Graphics.transition(35)
Graphics.freeze
@door.dispose
and add the sprite dispose under the last dispose.
@yourdoorname.dispose
hope this can help you