Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first commit, playable with decent physics, first levels started.
- Loading branch information
ippa
committed
Jun 20, 2010
0 parents
commit fd0394e
Showing
38 changed files
with
5,150 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- [] | ||
|
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
--- | ||
- Cloud: | ||
:x: 510.488207045311 | ||
:y: 304.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.05610561056105 | ||
:factor_y: 1.37931034482759 | ||
:color: 3506438143 | ||
- Cloud: | ||
:x: 874.473141318021 | ||
:y: 176.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 1123.49897643112 | ||
:y: 64.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 1427.70118298527 | ||
:y: 256.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.003300330033 | ||
:factor_y: 1.10344827586207 | ||
:color: 3506438143 | ||
- Cloud: | ||
:x: -994.714383187335 | ||
:y: 112.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.003300330033 | ||
:factor_y: 1.10344827586207 | ||
:color: 3506438143 | ||
- Cloud: | ||
:x: 264.98037562447 | ||
:y: 160.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 1439.42253863218 | ||
:y: 48.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.003300330033 | ||
:factor_y: 1.10344827586207 | ||
:color: 3506438143 | ||
- Cloud: | ||
:x: 1325.63449779569 | ||
:y: 272.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 1276.53433382172 | ||
:y: 112.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.003300330033 | ||
:factor_y: 1.10344827586207 | ||
:color: 3506438143 | ||
- Cloud: | ||
:x: 1756.33210777323 | ||
:y: 208.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2667577343 | ||
- Cloud: | ||
:x: 3253.69578022453 | ||
:y: 64.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 2634.65231360351 | ||
:y: 256.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.844884488448845 | ||
:factor_y: 0.856720154774098 | ||
:color: 3305111551 | ||
- Cloud: | ||
:x: 3454.73597261713 | ||
:y: 192.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.844884488448845 | ||
:factor_y: 0.856720154774098 | ||
:color: 3305111551 | ||
- Cloud: | ||
:x: 1777.14538918184 | ||
:y: 96.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 3693.67851595294 | ||
:y: 224.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.844884488448845 | ||
:factor_y: 0.856720154774098 | ||
:color: 3305111551 | ||
- Cloud: | ||
:x: 3179.26322010255 | ||
:y: 96.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Cloud: | ||
:x: 3074.74891165806 | ||
:y: 224.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.58415841584158 | ||
:factor_y: 1.68430636167065 | ||
:color: 2969567231 | ||
- Dirt: | ||
:x: 192.0 | ||
:y: 848.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.00502512562814 | ||
:factor_y: 1.02673796791444 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 592.0 | ||
:y: 848.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.00502512562814 | ||
:factor_y: 1.02673796791444 | ||
:color: 4294967295 | ||
- Battery: | ||
:x: 832.0 | ||
:y: 384.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.00900900900901 | ||
:factor_y: 1.11304347826087 | ||
:color: 4294967295 | ||
- Battery: | ||
:x: 496.0 | ||
:y: 400.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.00900900900901 | ||
:factor_y: 1.11304347826087 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 992.0 | ||
:y: 848.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 1.00502512562814 | ||
:factor_y: 1.02673796791444 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 64.0 | ||
:y: 592.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.36180904522613 | ||
:factor_y: 0.342245989304813 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 208.0 | ||
:y: 592.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.36180904522613 | ||
:factor_y: 0.342245989304813 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 352.0 | ||
:y: 592.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.36180904522613 | ||
:factor_y: 0.342245989304813 | ||
:color: 4294967295 | ||
- Dirt: | ||
:x: 512.0 | ||
:y: 576.0 | ||
:angle: 0 | ||
:zorder: 100 | ||
:factor_x: 0.36180904522613 | ||
:factor_y: 0.342245989304813 | ||
:color: 4294967295 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
class Collectable < GameObject | ||
traits :timer, :effect, :velocity | ||
trait :bounding_box, :debug => false | ||
|
||
attr_reader :title, :score | ||
|
||
def die | ||
puff_effect | ||
end | ||
|
||
def puff_effect | ||
self.collidable = false # Stops further collisiondetection | ||
self.rotation_rate = 5 | ||
self.scale_rate = 0.02 | ||
self.fade_rate = -5 | ||
self.velocity_y = -2 | ||
after(1000) { destroy } | ||
end | ||
end | ||
|
||
# | ||
# BATTERY | ||
# | ||
class Battery < Collectable | ||
def setup | ||
@image = Image["battery.png"] | ||
@title = "sparkling fresh battery acid" | ||
@score = 1000 | ||
cache_bounding_box | ||
end | ||
end | ||
|
||
class Drink < Collectable | ||
def setup | ||
@animation = Animation.new(:file => "drink.bmp", :size => [5,9]) | ||
@image = @animation.first | ||
@title = "frozen margarita" | ||
@score = 100 | ||
cache_bounding_box | ||
end | ||
|
||
def update | ||
@image = @animation.next | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class PuffText < Text | ||
traits :timer, :effect, :velocity | ||
|
||
def initialize(text, options = {}) | ||
super(text, :height => 40, :rotation_center => :center, :x => options[:from].x, :y => 400) | ||
puff_effect | ||
end | ||
|
||
#def setup | ||
# self.height = 40 | ||
# puff_effect | ||
#end | ||
|
||
def puff_effect | ||
self.scale_rate = 0.005 | ||
self.fade_rate = -1 | ||
self.velocity_y = -1 | ||
after(2000) { destroy } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class Effect < GameObject | ||
traits :effect, :velocity | ||
|
||
def initialize(options = {}) | ||
super | ||
@amount = (options[:amount] || 5).to_i - 1 | ||
@child = options[:child] | ||
self.size = options[:size] || [50, 50] | ||
|
||
@amount.times { self.class.create(options.merge(:child => true)) } unless @child | ||
end | ||
|
||
end | ||
|
||
|
||
class SmokePuff < Effect | ||
def setup | ||
@image = Image["circle.png"] | ||
self.scale_rate = rand/100 | ||
self.alpha = 70 | ||
self.fade_rate = -4 | ||
self.velocity = rand-0.5, rand-0.5 | ||
end | ||
|
||
def update | ||
destroy if self.alpha == 0 | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# A FIREBALL | ||
# | ||
class FireBall < GameObject | ||
traits :velocity, :collision_detection | ||
trait :bounding_circle, :scale => 0.7 | ||
|
||
def setup | ||
@animation = Animation.new(:file => "fireball.png", :size => [32,32], :delay => 20) | ||
@image = @animation.first | ||
self.mode = :additive | ||
self.factor = 3 | ||
self.velocity_y = 1 | ||
self.zorder = 200 | ||
self.rotation_center = :center | ||
end | ||
|
||
def update | ||
@image = @animation.next | ||
@angle += 2 | ||
end | ||
end | ||
|
||
# | ||
# COG WHEEL | ||
# | ||
class CogWheel < GameObject | ||
traits :bounding_circle, :collision_detection, :timer | ||
attr_accessor :angle_velocity | ||
|
||
def setup | ||
@image = Image["cog_wheel.png"] | ||
@angle_velocity = 1 / self.factor_x | ||
end | ||
|
||
def update | ||
self.angle += @angle_velocity | ||
end | ||
end | ||
|
||
# | ||
# SAW | ||
# | ||
class Saw < GameObject | ||
traits :bounding_circle, :collision_detection, :timer, :velocity | ||
attr_accessor :angle_velocity | ||
|
||
def setup | ||
@image = Image["saw.png"] | ||
@angle_velocity = 3.0 / self.factor_x.to_f | ||
self.velocity_y = 1.0 / self.factor_x.to_f | ||
end | ||
|
||
def update | ||
self.angle += @angle_velocity | ||
end | ||
end | ||
|
Oops, something went wrong.