-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.rb
More file actions
43 lines (35 loc) · 816 Bytes
/
Copy pathmap.rb
File metadata and controls
43 lines (35 loc) · 816 Bytes
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
# coding: utf-8
class Map < Sprite
end
class Uki < Sprite
def initialize(x,y,image,height)
@s_x = x
@s_y = y
@height = height
super
end
def h
return @height
end
def init
self.x = @s_x
self.y = @s_y
end
def hit
$score += 100
if($player.y < (self.y - 10))
if($player.vy > 0)
$player.f_false
$player.vy = 0
end
shift_y = 761 - self.y
$player.y = self.y - $player.h + shift_y
$ukis.each do |uki|
uki.y += shift_y
end
$map.y += shift_y
elsif($player.y > (self.y + self.h))
$player.x = self.x
end
end
end