class EnemyBullet
Constants
- COOLDOWN_DELAY
- DAMAGE
- MAX_SPEED
Enemy y speeds are negative
Public Instance Methods
draw()
click to toggle source
include Gl include Glu include Glut
# File line-em-up/models/enemy_bullet.rb, line 21 def draw # draw nothing end
draw_gl()
click to toggle source
# File line-em-up/models/enemy_bullet.rb, line 26 def draw_gl new_pos_x, new_pos_y, increment_x, increment_y = convert_x_and_y_to_opengl_coords height = @image_height.to_f * increment_y z = ZOrder::Projectile glLineWidth(5 * @scale) glBegin(GL_LINES) glColor3f(1.0, 0.0, 0.0) glVertex3d(new_pos_x, new_pos_y, z) glVertex3d(new_pos_x, new_pos_y - height, z) glEnd # scale = 1.0 * @scale # glColor4f(scale, scale, scale, scale / 2) # glBegin(GL_QUADS) # glVertex3f(-1.0, +1.0, 0.0); # glVertex3f(-1.0, -1.0, 0.0) # glVertex3f(+1.0, -1.0, 0.0) # glVertex3f(+1.0, +1.0, 0.0) # glEnd end
get_image()
click to toggle source
# File line-em-up/models/enemy_bullet.rb, line 13 def get_image Gosu::Image.new("#{MEDIA_DIRECTORY}/bullet-mini-reverse.png") end