-
Notifications
You must be signed in to change notification settings - Fork 0
/
KOE.rb
60 lines (50 loc) · 1.23 KB
/
KOE.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# coding: UTF-8
def game_path
File.dirname(caller[0][/^.\:[^\:]*(?=\:)/])
end
require 'dxruby'
require_relative './battle'
require_relative './transition'
Window.resize(800,600)
AfterClear = Image.load(game_path + '/image/after_clear.png')
Loading = Image.loadTiles(game_path + '/image/Loading.png', 1, 10)
Rule = Image.load(game_path + '/image/rule.png')
module KOE
def self.change_scene(scene)
scene.old_scene = @@scene if scene.respond_to?(:old_scene=)
@@scene = scene
end
def self.update
@@scene.update if @@scene.respond_to?(:update)
end
def self.draw
@@scene.draw if @@scene.respond_to?(:draw)
end
end
ai = EnemyAI.new do
Fiber.yield :easy
Fiber.yield :cure_little
Fiber.yield :speed
Fiber.yield :easy_double
Fiber.yield :speed
Fiber.yield :speed_chase
Fiber.yield :cure
Fiber.yield :easy_chase
Fiber.yield :speed_chase
Fiber.yield :speed_double
Fiber.yield :cure_strong
Fiber.yield :three
Fiber.yield :five
Fiber.yield :wall_easy
Fiber.yield :wall_easy
Fiber.yield :wall_hard
Fiber.yield :wall_hard
Fiber.yield :tricky
Fiber.yield :finish
end
KOE.change_scene(Battle.new(ai, nil, nil))
Window.loop do
KOE.update
KOE.draw
Window.caption = Window.real_fps.to_s
end