Inheritance: Vtj.Gaming.Scene
コード例 #1
0
ファイル: CloudSystem.cs プロジェクト: rasch1/Space-Dinosaurs
        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;
            });
        }
コード例 #2
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);
            });
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: RoadSystem.cs プロジェクト: rasch1/Space-Dinosaurs
        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);
        }
コード例 #5
0
ファイル: CloudSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 public override void Dispose()
 {
     _level = null;
     _clouds = null;
     _cloudImage = null;
     _explosionImage = null;
     _explosions = null;
     _flakImage = null;
     _flakObjects = null;
 }
コード例 #6
0
 public override void Dispose()
 {
     _level          = null;
     _clouds         = null;
     _cloudImage     = null;
     _explosionImage = null;
     _explosions     = null;
     _flakImage      = null;
     _flakObjects    = null;
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 public override void Dispose()
 {
     if (_engine != null)
     {
         _engine.Pause();
         _engine.RemoveEventListener("timeupdate", _timeUpdatedListener, false);
     }
     _playThroughListener = null;
     _timeUpdatedListener = null;
     _level  = null;
     _engine = null;
 }
コード例 #9
0
 public override void Dispose()
 {
     if (_engine != null)
     {
         _engine.Pause();
         _engine.RemoveEventListener("timeupdate", _timeUpdatedListener, false);
     }
     _playThroughListener = null;
     _timeUpdatedListener = null;
     _level = null;
     _engine = null;
 }
コード例 #10
0
 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);
 }
コード例 #11
0
ファイル: NpcSystem.cs プロジェクト: Ventajou/Space-Dinosaurs
 public override void Dispose()
 {
     _animationSequences = null;
     _level = null;
     _npcs = null;
 }
コード例 #12
0
ファイル: RoadSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 public override void Dispose()
 {
     _level  = null;
     _road   = null;
     _events = null;
 }
コード例 #13
0
 public override void Dispose()
 {
     _level = null;
     _road = null;
     _events = null;
 }
コード例 #14
0
ファイル: CarSystem.cs プロジェクト: Ventajou/Space-Dinosaurs
 public override void Dispose()
 {
     _level = null;
 }
コード例 #15
0
ファイル: CarSystem.cs プロジェクト: rasch1/Space-Dinosaurs
        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);
        }
コード例 #16
0
ファイル: NpcSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 public override void Dispose()
 {
     _animationSequences = null;
     _level = null;
     _npcs  = null;
 }
コード例 #17
0
 public override void Dispose()
 {
     _level   = null;
     _objects = null;
 }
コード例 #18
0
 public override void Init(Scene level)
 {
     _level = (RaceLevel)level;
     _objectIndex = 0;
     AddObjects(_level.RoadLength);
 }
コード例 #19
0
 public override void Dispose()
 {
     _level = null;
     _objects = null;
 }
コード例 #20
0
ファイル: CarSystem.cs プロジェクト: Ventajou/Space-Dinosaurs
        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);
        }
コード例 #21
0
 public override void Init(Scene level)
 {
     _level       = (RaceLevel)level;
     _objectIndex = 0;
     AddObjects(_level.RoadLength);
 }
コード例 #22
0
ファイル: NpcSystem.cs プロジェクト: Ventajou/Space-Dinosaurs
 public override void Init(Scene level)
 {
     _level = (RaceLevel)level;
     EnsureAnimationSequences();
     AddNpcs(_level.RoadLength);
 }
コード例 #23
0
ファイル: NpcSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 public override void Init(Scene level)
 {
     _level = (RaceLevel)level;
     EnsureAnimationSequences();
     AddNpcs(_level.RoadLength);
 }
コード例 #24
0
ファイル: CarSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 public override void Dispose()
 {
     _level = null;
 }