Skip to content

Commit

Permalink
Spawn the enemies on all maps
Browse files Browse the repository at this point in the history
  • Loading branch information
timotei committed Sep 17, 2011
1 parent b039df5 commit f607d62
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
11 changes: 11 additions & 0 deletions egp_story/Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,16 @@ private bool IsNewPositionOK( LevelMap levelMap, Rectangle rectangle )
!levelMap.ThePlayer.BoundingBox.Intersects( rectangle ) &&
CheckHitAndRemove( levelMap, rectangle, false ) == null );
}

public static Enemy CreateBugEnemy( Game game )
{
return new Enemy( game, CardinalDirection.SOUTH, null,
new[] {
new AnimatedSprite( Assets.BugWalkNorth, 2, 5 ),
new AnimatedSprite( Assets.BugWalkSouth, 2, 5 ),
new AnimatedSprite( Assets.BugWalkEast, 2, 5 )},
null
);
}
}
}
5 changes: 4 additions & 1 deletion egp_story/Levels/Calipuirr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public Calipuirr( Game game )
: base( game )
{
Player player = Player.CreateNewHarapAlb( game );
LevelMap = new LevelMap( player, null, Assets.CalipuirrBackground, Assets.CalipuirrBackgroundMask );
Enemy bugEnemy = Enemy.CreateBugEnemy( game );

LevelMap = new LevelMap( player, bugEnemy,
Assets.CalipuirrBackground, Assets.CalipuirrBackgroundMask );
}
}
}
5 changes: 4 additions & 1 deletion egp_story/Levels/EllyuteionLake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public EllyuteionLake( Game game )
: base( game )
{
Player player = Player.CreateNewHarapAlb( game );
LevelMap = new LevelMap( player, null, Assets.EllyuteionLakeBackground, Assets.EllyuteionLakeBackgroundMask );
Enemy bugEnemy = Enemy.CreateBugEnemy( game );

LevelMap = new LevelMap( player, bugEnemy,
Assets.EllyuteionLakeBackground, Assets.EllyuteionLakeBackgroundMask );
}
}
}
5 changes: 4 additions & 1 deletion egp_story/Levels/MirrosHills.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public MirrosHills( Game game )
: base( game )
{
Player player = Player.CreateNewHarapAlb( game );
LevelMap = new LevelMap( player, null, Assets.MirrosHillsBackground, Assets.MirrosHillsBackgroundMask );
Enemy bugEnemy = Enemy.CreateBugEnemy( game );

LevelMap = new LevelMap( player, bugEnemy,
Assets.MirrosHillsBackground, Assets.MirrosHillsBackgroundMask );
}
}
}
5 changes: 4 additions & 1 deletion egp_story/Levels/Pandorashys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public Pandorashys( Game game )
: base( game )
{
Player player = Player.CreateNewHarapAlb( game );
LevelMap = new LevelMap( player, null, Assets.PandorashysBackground, Assets.PandorashysBackgroundMask );
Enemy bugEnemy = Enemy.CreateBugEnemy( game );

LevelMap = new LevelMap( player, bugEnemy,
Assets.PandorashysBackground, Assets.PandorashysBackgroundMask );
}
}
}
12 changes: 3 additions & 9 deletions egp_story/Levels/ViridesPuirr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ public ViridesPuirr( Game game )
: base( game )
{
Player player = Player.CreateNewHarapAlb( game );
Enemy bugEnemy = Enemy.CreateBugEnemy( game );

Enemy bugEnemy = new Enemy( game, CardinalDirection.SOUTH, null,
new[] {
new AnimatedSprite( Assets.BugWalkNorth, 2, 5 ),
new AnimatedSprite( Assets.BugWalkSouth, 2, 5 ),
new AnimatedSprite( Assets.BugWalkEast, 2, 5 )},
null
);

LevelMap = new LevelMap( player, bugEnemy, Assets.ViridesPuirrBackground, Assets.ViridesPuirrBackgroundMask );
LevelMap = new LevelMap( player, bugEnemy,
Assets.ViridesPuirrBackground, Assets.ViridesPuirrBackgroundMask );
}
}
}

0 comments on commit f607d62

Please sign in to comment.