class Scene_Classes < Scene_MenuBase
def start
super
@class = []
@index = 0
@y = 1
@x = 1
create_interface
end
def update
super
movement
end
def create_interface
@fon = Sprite.new
@fon.bitmap = Bitmap.new("Graphics/Classes/fon")
@class[0] = Sprite.new
@class[0].bitmap = Bitmap.new("Graphics/Classes/0")
@class[0].x = 100
@class[0].y = 60
@class[0].z = @fon.z + 1
@class[1] = Sprite.new
@class[1].bitmap = Bitmap.new("Graphics/Classes/1")
@class[1].x = 340
@class[1].y = 60
@class[1].z = @fon.z + 1
@class[2] = Sprite.new
@class[2].bitmap = Bitmap.new("Graphics/Classes/2")
@class[2].x = 100
@class[2].y = 165
@class[2].z = @fon.z + 1
@class[3] = Sprite.new
@class[3].bitmap = Bitmap.new("Graphics/Classes/3")
@class[3].x = 340
@class[3].y = 165
@class[3].z = @fon.z + 1
@class[4] = Sprite.new
@class[4].bitmap = Bitmap.new("Graphics/Classes/4")
@class[4].x = 100
@class[4].y = 270
@class[4].z = @fon.z + 1
@class[5] = Sprite.new
@class[5].bitmap = Bitmap.new("Graphics/Classes/5")
@class[5].x = 340
@class[5].y = 270
@class[5].z = @fon.z + 1
@class[6] = Sprite.new
@class[6].bitmap = Bitmap.new("Graphics/Classes/6")
@class[6].x = 100
@class[6].y = 375
@class[6].z = @fon.z + 1
@class[7] = Sprite.new
@class[7].bitmap = Bitmap.new("Graphics/Classes/7")
@class[7].x = 340
@class[7].y = 375
@class[7].z = @fon.z + 1
@cursore = Sprite.new
@cursore.bitmap = Bitmap.new("Graphics/Classes/cursor")
@cursore.x = @class[@index].x
@cursore.y = @class[@index].y
@cursore.z = @fon.z + 1
end
def cursor
@cursore.x = @class[@index].x
@cursore.y = @class[@index].y
@cursore.z = @fon.z + 1
end
def choise
Audio.se_play("Audio/SE/Blind",50)
$game_actors[1].change_class(@index + 1)
$game_actors[1].set_graphic("Heroes", @index, "face229b", 0)
$game_player.refresh
return_scene
end
def movement
choise if Input.trigger?(:C)
up if Input.repeat?(:UP)
down if Input.repeat?(:DOWN)
left if Input.repeat?(:LEFT)
right if Input.repeat?(:RIGHT)
end
def up
if @y == 1
@y = 4
@index +=6
cursor
else
@y -= 1
@index -=2
cursor
end
Audio.se_play("Audio/SE/Cursor1",50)
end
def down
if @y == 4
@y = 1
@index -=6
cursor
else
@y += 1
@index +=2
cursor
end
Audio.se_play("Audio/SE/Cursor1",50)
end
def left
if @x == 1
@x = 2
@index +=1
cursor
else
@x -= 1
@index -=1
cursor
end
Audio.se_play("Audio/SE/Cursor1",50)
end
def right
if @x == 2
@x = 1
@index -=1
cursor
else
@x += 1
@index +=1
cursor
end
Audio.se_play("Audio/SE/Cursor1",50)
end
end