class RTanque::Gui::Shell
Constants
- DEBUG
Attributes
shell[R]
Public Class Methods
new(window, shell)
click to toggle source
# File lib/rtanque/gui/shell.rb, line 10 def initialize(window, shell) @window = window @shell = shell @x0 = shell.position.x @y0 = @window.height - shell.position.y @shell_image = Gosu::Image.new(@window, Gui.resource_path("images/bullet.png")) end
Public Instance Methods
draw()
click to toggle source
# File lib/rtanque/gui/shell.rb, line 18 def draw position = [self.shell.position.x, @window.height - self.shell.position.y] @shell_image.draw_rot(position[0], position[1], ZOrder::SHELL, 0, 0.5, 0.5) if DEBUG then white = Gosu::Color::WHITE pos = shell.position x1, y1 = pos.x, @window.height - pos.y @window.draw_line @x0, @y0, white, x1, y1, white, ZOrder::SHELL end end