-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbullet.rb
63 lines (50 loc) · 1006 Bytes
/
bullet.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
61
require 'jogador'
class Bullet
attr_reader :x, :y, :angulo
attr_accessor :x, :y, :angulo
def initialize(janela,x,y,angulo)
@janela = janela
@x = x
@y = y
@angulo = angulo
@imagens = Gosu::Image.new(@janela,"media/bulletz3.png", true)
end
def draw
imagem= @imagens
imagem.draw_rot(@x, @y, 4, @angulo)
end
def move
self.x += Gosu::offset_x(@angulo, 20)
self.y += Gosu::offset_y(@angulo, 20)
end
end
class Clip
attr_reader :x, :y
attr_accessor :x, :y
def initialize(janela,x,y)
@janela = janela
@x = x
@y = y
@angulo = 0
@imagens = Gosu::Image.new(@janela,"media/bullets.png", true)
end
def draw
imagem= @imagens
imagem.draw_rot(@x, @y, 2, (@angulo += 1)%360)
end
end
class Shotgun
attr_reader :x, :y
attr_accessor :x, :y
def initialize(janela,x,y)
@janela = janela
@x = x
@y = y
@angulo = 0
@imagens = Gosu::Image.new(@janela, "media/m3_d.bmp", true)
end
def draw
imagem= @imagens
imagem.draw_rot(@x, @y, 2, @angulo)
end
end