Created
May 12, 2012 16:17
-
-
Save shawn42/2667405 to your computer and use it in GitHub Desktop.
proposed behavior dsl
This file contains hidden or 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
# CURRENT | |
has_behavior animated: {:frame_update_time => 900} | |
has_behavior collidable: {shape: :polygon, cw_local_points: [[4,4],[44,4],[44,44],[4,44]]} | |
has_behavior projectile: {speed: 0.01, direction: vec2(1,0)} | |
has_behavior :reversable_direction | |
has_behavior increasing_speed: { accel: 0.001 } | |
has_behavior drops: { fall_amount: 25} | |
has_behavior shooter: {shoots: :alien_missile, direction: vec2(0,-1)} | |
# PROPOSED using some sort of method missing on behavior definition or something | |
has_behaviors do | |
animated frame_update_time: 900 | |
collidable shape: :polygon, cw_local_points: [[4,4],[44,4],[44,44],[4,44]] | |
projectile speed: 0.01, direction: vec2(1,0) | |
reversable_direction | |
increasing_speed accel: 0.001 | |
drops fall_amount: 25 | |
shooter shoots: :alien_missile, direction: vec2(0,-1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment