Skip to content

Commit

Permalink
first commit, playable with decent physics, first levels started.
Browse files Browse the repository at this point in the history
  • Loading branch information
ippa committed Jun 20, 2010
0 parents commit fd0394e
Show file tree
Hide file tree
Showing 38 changed files with 5,150 additions and 0 deletions.
873 changes: 873 additions & 0 deletions beach.yml

Large diffs are not rendered by default.

2,145 changes: 2,145 additions & 0 deletions factory.yml

Large diffs are not rendered by default.

1,364 changes: 1,364 additions & 0 deletions gfx.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions intro.yml
@@ -0,0 +1,2 @@
--- []

Binary file added media/ball.bmp
Binary file not shown.
Binary file added media/battery.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/beach.bmp
Binary file not shown.
Binary file added media/beach_block.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/beach_droid.bmp
Binary file not shown.
Binary file added media/beach_droid.gal
Binary file not shown.
Binary file added media/black_block.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/bubble.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/circle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/cloud.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/cog_wheel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/dirt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/drink.bmp
Binary file not shown.
Binary file added media/drink.gal
Binary file not shown.
Binary file added media/drink_droid.bmp
Binary file not shown.
Binary file added media/drink_droid.gal
Binary file not shown.
Binary file added media/droid.gal
Binary file not shown.
Binary file added media/droid_11x15.bmp
Binary file not shown.
Binary file added media/fireball.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/pause_droid.gal
Binary file not shown.
Binary file added media/saw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/star.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/talk_bubble.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/tube.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
209 changes: 209 additions & 0 deletions outdoor.yml
@@ -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
45 changes: 45 additions & 0 deletions src/collectables.rb
@@ -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
20 changes: 20 additions & 0 deletions src/decoration.rb
@@ -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
30 changes: 30 additions & 0 deletions src/effects.rb
@@ -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


58 changes: 58 additions & 0 deletions src/enemy.rb
@@ -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

0 comments on commit fd0394e

Please sign in to comment.