Permalink
Browse files

Keep libs around

  • Loading branch information...
1 parent 53d8008 commit 3b6b90292d6a53d65970c004eafbc616258d6cc2 Amos Wenger committed Dec 18, 2011
Showing with 11 additions and 13 deletions.
  1. +1 −1 .gitignore
  2. +1 −2 assets/levels/level1.json
  3. 0 libs/.keepit
  4. +9 −10 source/game/Baddie.ooc
View
@@ -1,5 +1,5 @@
libs/*
-build/*
+!libs/.keepit
.libs
alone
.*.swp
@@ -10,7 +10,7 @@
{
"type": "swarm",
"pos": [ 40.0, 40.0 ],
- "population": 30
+ "population": 8
},
{
@@ -22,7 +22,6 @@
"type": "platform",
"kind": "metal",
"pos" : [ 200.0, 500.0 ],
- "size": [ 100.0, 40.0 ]
}
]
}
View
No changes.
View
@@ -17,7 +17,7 @@ Baddie: class extends Actor {
hero: Hero
- mainSprite: EllipseSprite
+ mainSprite: Sprite
bb: RectSprite // bounding box
box: Box
@@ -32,8 +32,6 @@ Baddie: class extends Actor {
collideCounter := 0
collideDuration := 15
- scale := 0.25
-
state := BaddieState CMON
init: func (=level) {
@@ -45,15 +43,13 @@ Baddie: class extends Actor {
bb = RectSprite new(body pos)
bb filled = false
- bb size = vec2(10, 10)
+ bb size = vec2(40, 40)
bb color = vec3(0.3, 0.3, Random randInt(0, 255) / 255.0)
- level sprites add(bb)
+ // level sprites add(bb)
- mainSprite = EllipseSprite new(body pos)
- mainSprite size = vec2(15, 15)
- mainSprite color = vec3(0.4, 0.4, Random randInt(0, 255) / 255.0)
- mainSprite alpha = 0.4
- level sprites add(bb)
+ mainSprite = SvgSprite new(body pos, "assets/svg/baddies/Baddie1_Full.svg")
+ mainSprite scale = vec2(0.2, 0.2)
+ mainSprite offset = vec2(-40, -40)
level sprites add(mainSprite)
box = Box new(bb)
@@ -77,6 +73,9 @@ Baddie: class extends Actor {
if (hero body speed norm() > 3.0) {
state = BaddieState CMON
+ level collides?(box, |bang|
+ state = BaddieState WTF
+ )
} else if (diff norm() < 300.0) {
state = BaddieState GTFO
} else {

0 comments on commit 3b6b902

Please sign in to comment.