public override void Init(Scene level) { _level = (RaceLevel)level; _cloudImage = _level.LoadImage("Images/Race/cloud.png", false); _explosionImage = _level.LoadImage("Images/Race/explosion.png", false); _explosions = new List<Explosion>(); _flakImage = _level.LoadImage("Images/Race/flak.png", false); _flakObjects = new List<FlakObject>(); // Build the background clouds for (int i = 0; i < 30; i++) { Cloud cloud = new Cloud(); cloud.X = Math.Floor(Math.Random() * 2401) - 1200; cloud.Y = Math.Floor(Math.Random() * 300); _clouds.Add(cloud); } _clouds.Sort(delegate(Cloud x, Cloud y) { if (x.Y < y.Y) return 1; if (x.Y > y.Y) return -1; return 0; }); }
public override void Init(Scene level) { _level = (RaceLevel)level; _cloudImage = _level.LoadImage("Images/Race/cloud.png", false); _explosionImage = _level.LoadImage("Images/Race/explosion.png", false); _explosions = new List <Explosion>(); _flakImage = _level.LoadImage("Images/Race/flak.png", false); _flakObjects = new List <FlakObject>(); // Build the background clouds for (int i = 0; i < 30; i++) { Cloud cloud = new Cloud(); cloud.X = Math.Floor(Math.Random() * 2401) - 1200; cloud.Y = Math.Floor(Math.Random() * 300); _clouds.Add(cloud); } _clouds.Sort(delegate(Cloud x, Cloud y) { if (x.Y < y.Y) { return(1); } if (x.Y > y.Y) { return(-1); } return(0); }); }
public override void Init(Scene level) { _level = (RaceLevel)level; _road[0] = _level.LoadImage("Images/Race/road1.png", false); _road[1] = _level.LoadImage("Images/Race/road2.png", false); BuildEvents(_level.RoadLength); }
public override void Dispose() { _level = null; _clouds = null; _cloudImage = null; _explosionImage = null; _explosions = null; _flakImage = null; _flakObjects = null; }
public override void Init(Scene level) { _level = (RaceLevel)level; _playThroughListener = SoundLoaded; _timeUpdatedListener = TimeUpdated; if (jQuery.Browser.Mozilla || jQuery.Browser.Opera) _engine = _level.LoadAudio("Audio/Race/engine.ogg"); else _engine = _level.LoadAudio("Audio/Race/engine.mp3"); _engine.AddEventListener("canplaythrough", _playThroughListener, false); }
public override void Dispose() { if (_engine != null) { _engine.Pause(); _engine.RemoveEventListener("timeupdate", _timeUpdatedListener, false); } _playThroughListener = null; _timeUpdatedListener = null; _level = null; _engine = null; }
public override void Init(Scene level) { _level = (RaceLevel)level; _playThroughListener = SoundLoaded; _timeUpdatedListener = TimeUpdated; if (jQuery.Browser.Mozilla || jQuery.Browser.Opera) { _engine = _level.LoadAudio("Audio/Race/engine.ogg"); } else { _engine = _level.LoadAudio("Audio/Race/engine.mp3"); } _engine.AddEventListener("canplaythrough", _playThroughListener, false); }
public override void Dispose() { _animationSequences = null; _level = null; _npcs = null; }
public override void Dispose() { _level = null; _road = null; _events = null; }
public override void Dispose() { _level = null; }
public override void Init(Scene level) { _level = (RaceLevel)level; CarObject = new GameObject(); AnimationSequence sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/c1.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c1_2.png", false), 165, 134); CarObject.AnimationSequences["Forward"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c1.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c1_2.png", false), 165, 134); CarObject.AnimationSequences["b-Forward"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/c3.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c3_2.png", false), 165, 134); CarObject.AnimationSequences["Left"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c3.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c3_2.png", false), 165, 134); CarObject.AnimationSequences["b-Left"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/c13.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c13_2.png", false), 165, 134); CarObject.AnimationSequences["Right"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c13.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c13_2.png", false), 165, 134); CarObject.AnimationSequences["b-Right"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 100; sequence.AddSprite(_level.LoadImage("Images/Race/car/c1.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c5.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c6.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c7.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c8.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c9.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c10.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c11.png", false), 165, 134); sequence.Loop = false; CarObject.AnimationSequences["Crash"] = sequence; sequence = new AnimationSequence(); sequence.Delay = 200; sequence.AddSprite(_level.LoadImage("Images/Race/car/c11.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c10.png", false), 165, 134); sequence.AddSprite(_level.LoadImage("Images/Race/car/c9.png", false), 165, 134); sequence.Loop = false; CarObject.AnimationSequences["Skid"] = sequence; CarObject.StartAnimation("Forward"); CarObject.AnimationCompleted += new AnimationCompletedEventHandler(AnimationCompleted); }
public override void Dispose() { _level = null; _objects = null; }
public override void Init(Scene level) { _level = (RaceLevel)level; _objectIndex = 0; AddObjects(_level.RoadLength); }
public override void Init(Scene level) { _level = (RaceLevel)level; EnsureAnimationSequences(); AddNpcs(_level.RoadLength); }