Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup

  • Loading branch information...
commit f5319e5eaa89c3652da716210bb1afda386dd145 1 parent 17719ee
@beanieboi beanieboi authored
View
11 GameLoop.rb
@@ -7,8 +7,7 @@
#
class GameLoop
- attr_accessor :view
- attr_accessor :timer, :player, :elements, :scene, :teams, :stop
+ attr_accessor :view, :timer, :player, :elements, :scene, :teams, :stop
def initialize(view)
self.view = view
@@ -59,16 +58,10 @@ def stop_timer
def set_viewport_rectangle(bounds)
return
- puts bounds.inspect
-
- glViewport(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height)
+ glViewport(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity
gluPerspective(30, bounds.size.width / bounds.size.height, 1.0, 1000.0)
-
-# glMatrixMode(GL_MODELVIEW)
-# glLoadIdentity
-
end
end
View
3  GameView.rb
@@ -27,7 +27,6 @@ def initWithFrame(frame)
end
def prepareOpenGL
-# glEnable(GL_DEPTH_TEST)
glEnable(GL_CULL_FACE)
glEnable(GL_MULTISAMPLE)
glAlphaFunc ( GL_GREATER, 0.1 )
@@ -41,8 +40,6 @@ def acceptsFirstResponder
def drawRect(rect)
return unless @active
-# setNeedsDisplay true
-# openGLContext.flushBuffer
end
def reshape
View
3  Plane.rb
@@ -17,6 +17,7 @@ def self.draw
glVertex3f(-0.09, -0.01, 0.0);
glVertex3f( 0.025, -0.01, 0.0);
glEnd
+
# Tail
glBegin(GL_QUADS)
glVertex3f(-0.07, -0.03, 0.0);
@@ -25,6 +26,7 @@ def self.draw
glVertex3f(-0.08, -0.03, 0.0);
glVertex3f(-0.07, -0.03, 0.0);
glEnd
+
# Main wing
glColor3f(0.5,0.5,0.5)
glBegin(GL_QUADS)
@@ -34,6 +36,5 @@ def self.draw
glVertex3f(-0.02, -0.07, 0.0);
glVertex3f( 0.01, -0.07, 0.0);
glEnd
-
end
end
View
6 Player.rb
@@ -5,8 +5,6 @@
# Created by Thomas R. Koll on 09.12.10.
# Copyright (c) 2010 ananasblau. All rights reserved.
#
-#require 'placable'
-#require 'movable'
require 'visibility'
class Player
@@ -14,8 +12,7 @@ class Player
include Movable
include Visibility
- attr_accessor :view_angle,
- :score, :score_history
+ attr_accessor :view_angle, :score, :score_history
def initialize
self.orientation = 0
@@ -98,5 +95,4 @@ def make_picture(planes)
self.score + score_delta
score_history.map{|k, history| history.unshift(0); }
end
-
end
View
1  Scene.rb
@@ -20,6 +20,5 @@ def redraw(tick)
glVertex3f( -0.9, 0.9, 0.0);
glVertex3f( -0.9, -0.7, 0.0);
glEnd
-
end
end
View
2  Score.rb
@@ -39,7 +39,7 @@ def draw
glPopMatrix
end
end
-
+
def +(score)
self.score += score
self
View
2  Team.rb
@@ -8,7 +8,7 @@
require 'team'
class Team
attr_accessor :planes, :name, :colour
-
+
def initialize(name, colour = [0,0,0], number_of_planes = 0)
self.name = name
self.colour = colour
View
3  Visibility.rb
@@ -19,9 +19,8 @@ def objects_in_view(objects)
# nur im Rückschritt liegt die Zukunft
a = self.x - object.x
b = self.y - object.y
-
- gamma = Math.atan2(b,a)
+ gamma = Math.atan2(b,a)
gamma = ((gamma / Math::PI * 180) + 180) % 360
n = view_angle[0]
Please sign in to comment.
Something went wrong with that request. Please try again.