示例#1
0
        static void Main(string[] args)
        {
            List <ICreature> creatures = new List <ICreature>();

            creatures.Add(new Hero("Mira", new Bag(), 5, 5));
            Scene1 scene1 = new Scene1(creatures);
        }
示例#2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Mesh = new MeshGeometry(XSize, ZSize, CellSize)
     {
         Position             = new Vector3D(0, 0, 0),
         InitialRotationAxis  = new Vector3D(0, 0, 0),
         RotationAxis         = new Vector3D(0, 0, 0),
         RotationSpeed        = 0.0,
         AmbientMaterial      = Colors.Black,
         DiffuseMaterial      = Color.FromRgb(150, 150, 150),
         SpecularMaterial     = Colors.Black,
         Shininess            = 30,
         DrawMode             = DrawMode.Fill,
         LineWidth            = 1.0,
         PointSize            = 1.0,
         UseMaterial          = true,
         UseVertexColors      = false,
         UseTexture           = false,
         TextureScaleX        = 1.0,
         TextureScaleY        = 1.0,
         VertexColorIntensity = 1.0
     };
     Scene1.Lights[0].Direction = new Vector3D(-3, -2, -1);
     //Scene1.Camera.Position = new Vector3D(0, 12.0, 42.0);
     Scene1.Camera = new FixedCamera(new Vector3D(0, 1.5 * PeakHeight, ZSize * CellSize / 2), new Vector3D(0, 2, 0), new Vector3D(0, 1, 0));
     Scene1.AddGeometry(Mesh);
 }
    // Update is called once per frame
    void Update()
    {
        GameObject SceneManager = GameObject.FindWithTag("SceneManager");
        Scene1     ScoreCounter = SceneManager.GetComponent <Scene1>();
        Scene1     ResetOnGoing = SceneManager.GetComponent <Scene1>();

        //Reset
        if (ResetOnGoing.bResetOnGoing == true)
        {
            Destroy(gameObject);
        }

        //Destroyed
        if ((iHealth <= 0) && (bAlive))
        {
            aAudioSource.PlayOneShot(aDestroySound, 1.0f);
            STGEngine.ScoretoAddtoCounter(ScoreCounter.tScoreCounter, 1);
            if (!bThisIsSmallRubble)
            {
                STGEngine.SpawnPrefab(rSmallRubble, this.transform.position, this.transform.rotation, new Vector2(1, -1), 1);
                STGEngine.SpawnPrefab(rSmallRubble, this.transform.position, this.transform.rotation, new Vector2(-1, -1), 1);
            }
            bAlive = false;
        }

        if (!bAlive)
        {
            gameObject.GetComponent <BoxCollider2D>().isTrigger = true;
            Destroy(gameObject, 0.1f);
        }
    }
    public static void SaveScene1(Scene1 scene1)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/scene1.data";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        Scene1Data data = new Scene1Data(scene1);

        formatter.Serialize(stream, data);
        stream.Close();
    }
示例#5
0
    // Start is called before the first frame update
    void Start()
    {
        Scene1 scene1 = new Scene1();
        Scene2 scene2 = new Scene2();

        SceneManagr.addScene(scene1);
        SceneManagr.addScene(scene2);


        SceneManagr.go(scene1.StateId, "zzzz");
        SceneManagr.go(scene2.StateId, "xxxx");
    }
示例#6
0
        protected override void Initialize()
        {
            base.Initialize();
            Scene.SetDefaultDesignResolution(320, 320, Scene.SceneResolutionPolicy.ShowAllPixelPerfect);

            Scenes = new Dictionary <string, Func <Scene> >
            {
                { "1", () => new Scene1() },
            };

            Scene = new Scene1();
        }
示例#7
0
 void Awake()
 {
     if (master == null)
     {
         DontDestroyOnLoad(gameObject);
         master = this;
         Scene1 = GetComponent <Scene1>().GetThis();
     }
     else if (master != this)
     {
         Destroy(gameObject);
     }
 }
    // Update is called once per frame
    void Update()
    {
        GameObject SceneManager = GameObject.FindWithTag("SceneManager");
        Scene1     ResetOnGoing = SceneManager.GetComponent <Scene1>();

        //Reset
        if (ResetOnGoing.bResetOnGoing == true)
        {
            Destroy(gameObject);
        }

        if (bMissile) //A Missile Type
        {
            AIFrames.EventAIStart();
            switch (AIFrames.iMovementStage)
            {
            case 1:
                STGEngine.ShootAiming("Player");
                GameObject Target = GameObject.Find("Player");
                if (Target)
                {
                    vLockon = new Vector2(Target.transform.position.x, Target.transform.position.y);
                }
                else
                {
                    //Debug.Log("No Target");
                }
                if (!bMissileDeployedSound)
                {
                    aAudioSource.PlayOneShot(aReadySound, 2);
                    bMissileDeployedSound = true;
                }
                AIFrames.EventMoveEnd(2);
                break;

            case 2:
                if (!bMissileShootSound)
                {
                    aAudioSource.PlayOneShot(aShootSound, 2);
                    bMissileShootSound = true;
                }
                STGEngine.MoveTowards(vLockon, 10.0f);
                if ((this.transform.position.x == vLockon.x) && (this.transform.position.y == vLockon.y))
                {
                    STGEngine.ShootAround(rExplosion, 10, 5.0f);
                    Destroy(gameObject);
                }
                break;
            }
        }
    }
示例#9
0
    // Update is called once per frame
    void Update()
    {
        GameObject SceneManager = GameObject.FindWithTag("SceneManager");
        Scene1     ScoreCounter = SceneManager.GetComponent <Scene1>();
        Scene1     ResetOnGoing = SceneManager.GetComponent <Scene1>();

        //Reset
        if (ResetOnGoing.bResetOnGoing == true)
        {
            Destroy(gameObject);
        }

        AIFrames.EventAIStart();
        switch (AIFrames.iMovementStage)
        {
        case 1:
            if (iHealth > 0)
            {
                STGEngine.ShootConBullet(rMainProjec, new Vector2(0, -1.0f), fShipFireRate, 5.0f);
                STGEngine.ShootSoundBullet(aBasicShootSound, fShipFireRate);
            }
            break;
        }

        if ((this.transform.position.y <= 1))
        {
            Destroy(gameObject);
        }

        if ((iHealth <= 0) && (bAlive))
        {
            aAudioSource.PlayOneShot(aDestroySound, 1.0f);
            STGEngine.ScoretoAddtoCounter(ScoreCounter.tScoreCounter, 5);
            bAlive = false;
        }

        if (!bAlive)
        {
            fDeathSpin             += 5f;
            rThisBody.bodyType      = RigidbodyType2D.Dynamic;
            this.transform.rotation = Quaternion.Euler(180, 0, fDeathSpin);
            gameObject.GetComponent <BoxCollider2D>().isTrigger = true;
            Destroy(gameObject, 1.0f);
        }
    }
示例#10
0
        static void Main(string[] args)
        {
            //Scene1
            Scene1 scene1 = new Scene1();

            char[] choicesScene1;
            choicesScene1 = scene1.ExecuteScene1();

            //Scene2
            Scene2 scene2 = new Scene2();

            char[] choicesScene2;
            choicesScene2 = scene2.ExecuteScene2(choicesScene1);

            Console.WriteLine("************ RESULTS ************");
            Console.WriteLine("SCENE 1: Choice 1 = " + choicesScene1[0] + " Choice 2 = " + choicesScene1[1] + " Choice 3 = " + choicesScene1[2]);
            Console.WriteLine("SCENE 2: Choice 4 = " + choicesScene2[0]);
        }
示例#11
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     soundCenter = new SoundCenter(this);
     font        = Content.Load <SpriteFont>("MyFont");
     Services.AddService(typeof(SpriteBatch), spriteBatch);
     Services.AddService(typeof(SoundCenter), soundCenter);
     Services.AddService(typeof(SpriteFont), font);
     scene0 = new Scene0(this);
     scene1 = new Scene1(this, screenWidth, screenHeight, 1);
     scene2 = new Scene2(this, screenWidth, screenHeight);
     scene2.Hide();
     scene1.Hide();
     scene0.Show();
     Components.Add(scene0);
     Components.Add(scene1);
     Components.Add(scene2);
 }
示例#12
0
 protected override void LoadContent()
 {
     _spriteBatch   = new SpriteBatch(GraphicsDevice);
     _device        = _graphics.GraphicsDevice;
     ScreenWidth    = _device.PresentationParameters.BackBufferWidth;
     ScreenHeight   = _device.PresentationParameters.BackBufferHeight;
     _soundCenter   = new SoundCenter(this);
     _textureCenter = new TextureCenter(this);
     _font          = Content.Load <SpriteFont>("MyFont");
     Services.AddService(typeof(SpriteBatch), _spriteBatch);
     Services.AddService(typeof(SoundCenter), _soundCenter);
     Services.AddService(typeof(SpriteFont), _font);
     Services.AddService(typeof(TextureCenter), _textureCenter);
     _scene0 = new Scene0(this);
     _scene1 = new Scene1(this, _device);
     _scene1.Hide();
     _scene0.Show();
     Components.Add(_scene0);
     Components.Add(_scene1);
 }
示例#13
0
    public void Run()
    {
        // Altseedを初期化する。
        asd.Engine.Initialize("Transition_Fade", 640, 480, new asd.EngineOption());

        // シーンのインスタンスを生成する。
        var scene = new Scene1();

        // シーンをシーン1に設定する。
        asd.Engine.ChangeScene(scene);

        // Altseedのウインドウが閉じられていないか確認する。
        while (asd.Engine.DoEvents())
        {
            // Altseedを更新する。
            asd.Engine.Update();
        }

        // Altseedを終了する。
        asd.Engine.Terminate();
    }
示例#14
0
        private void CompositionTarget_Rendering(Object sender, EventArgs e)
        {
            if (!Rendering)
            {
                return;
            }
            double h;

            for (int I = 0; I < XSize; I++)
            {
                if (UseFastSimplex)
                {
                    h = PeakHeight * FastSimplexNoise.WideNoise2D(I * Scale * CellSize / 2, ZOff / 2, Roughness, 0.5, 1) - 0.3;
                }
                else if (UseOpenSimplex)
                {
                    h = PeakHeight * OpenSimplexNoise.WideNoise2D(I * Scale * CellSize, ZOff, Roughness, 0.5, 1) - 0.3;
                }
                else
                {
                    h = PeakHeight * PerlinNoise.WideNoise2D(I * Scale * CellSize, ZOff, Roughness, 0.5, 1) - 0.3;
                }
                if (h < 0)
                {
                    h = 0.05;
                }
                Elevations[I, 0] = h;
                for (int J = ZSize - 1; J > 0; J--)
                {
                    Elevations[I, J] = Elevations[I, J - 1];
                }
            }
            ZOff        -= Scale * CellSize;
            Mesh.Heights = Elevations;
            GC.Collect();
            Mesh.GenerateGeometry(Scene1);
            //Render the scene.
            Scene1.Render();
        }
示例#15
0
        private void CreateScene()
        {
            var cache = ResourceCache;

            BrickScene = new Scene();

            BrickScene.CreateComponent <Octree>();
            BrickScene.CreateComponent <DebugRenderer>();

            scene1 = new Scene1();
            scene1.CreateListOfBlocks(BrickScene);

            // Create a Zone component for ambient lighting & fog control
            var zoneNode = BrickScene.CreateChild("Zone");
            var zone     = zoneNode.CreateComponent <Zone>();

            zone.SetBoundingBox(new BoundingBox(-1000.0f, 1000.0f));
            zone.AmbientColor = new Color(0.15f, 0.15f, 0.15f);
            zone.FogColor     = new Color(0.5f, 0.5f, 0.7f);
            zone.FogStart     = 100.0f;
            zone.FogEnd       = 300.0f;

            // Create a directional light to the world. Enable cascaded shadows on it
            var lightNode = BrickScene.CreateChild("DirectionalLight");

            lightNode.SetDirection(new Vector3(0.6f, -1.0f, 0.8f));

            var light = lightNode.CreateComponent <Light>();

            light.LightType   = LightType.Directional;
            light.CastShadows = true;
            light.ShadowBias  = new BiasParameters(0.00025f, 0.5f);
            // Set cascade splits at 10, 50 and 200 world units, fade shadows out at 80% of maximum shadow distance
            light.ShadowCascade = new CascadeParameters(10.0f, 50.0f, 200.0f, 0.0f, 0.8f);

            // Create Jack node that will follow the path
            jackNode          = BrickScene.CreateChild("Jack");
            jackNode.Position = new Vector3(15.0f, 15.0f, 20.0f);
            AnimatedModel modelObject = jackNode.CreateComponent <AnimatedModel>();

            //modelObject.Model = cache.GetModel("Models/Jack.mdl");
            modelObject.SetMaterial(cache.GetMaterial("Materials/Moon.xml"));
            modelObject.CastShadows = true;

            // Create a NavigationMesh component to the scene root
            NavigationMesh navMesh = BrickScene.CreateComponent <NavigationMesh>();

            // Create a Navigable component to the scene root. This tags all of the geometry in the scene as being part of the
            // navigation mesh. By default this is recursive, but the recursion could be turned off from Navigable
            BrickScene.CreateComponent <Navigable>();
            // Add padding to the navigation mesh in Y-direction so that we can add objects on top of the tallest boxes
            // in the scene and still update the mesh correctly
            navMesh.Padding = new Vector3(0.0f, 10.0f, 0.0f);

            // Create the camera. Limit far clip distance to match the fog
            CameraNode = BrickScene.CreateChild("Camera");
            Camera camera = CameraNode.CreateComponent <Camera>();

            camera.FarClip = 300.0f;

            // Set an initial position for the camera scene node above the plane
            CameraNode.Position = new Vector3(57.48847f, 60.82811f, -60.87394f); //
            CameraNode.Rotation = new Quaternion(29.3f, 1.1f, 0.0f);

            var n = BrickScene.CreateChild("gui");

            var b = new Urho.Gui.Button();
            //b.
            ///var b = new UrhoSharp.Gu
            ///
            var bnNode = BrickScene.CreateChild("button");
            var btn    = new Button();

            btn.CreateButton("newBtn");
            btn.SetSize(500, 500);

            // bnNode.AddChild(btn);
        }
示例#16
0
    // Update is called once per frame
    void Update()
    {
        MovementScript    Move  = gameObject.AddComponent <MovementScript>();
        ShootingMechanics Shoot = gameObject.AddComponent <ShootingMechanics>();

        GameObject SceneManager = GameObject.FindWithTag("SceneManager");
        Scene1     ScoreCounter = SceneManager.GetComponent <Scene1>();
        Scene1     ResetOnGoing = SceneManager.GetComponent <Scene1>();

        //Reset
        if (ResetOnGoing.bResetOnGoing == true)
        {
            Destroy(gameObject);
        }

        fCooldownFireRate--;
        AIFrames.EventAIStart();
        if (iHealth > 0)
        {
            switch (AIFrames.iMovementStage)
            {
            case 1:
                Move.Towards(new Vector2(0, 0), 1);
                Shoot.AroundSwirl(rMainProjec, 10, 4);
                AIFrames.EventMoveEnd(12.0f);
                break;

            case 2:
                Move.Towards(new Vector2(-2.0f, 0), 1);
                STGEngine.ShootAroundSwirl(rMainProjec, 20, 0.05f, 4, 1, false);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 3:
                Shoot.Around(rMainProjec, 20, 4);
                AIFrames.EventMoveEnd(0.0f);
                break;

            case 4:
                STGEngine.MoveTowards(new Vector2(2.0f, 0), 1);
                STGEngine.ShootAroundSwirl(rMainProjec, 20, 0.05f, 4, 1, true);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 5:
                STGEngine.ShootAround(rMainProjec, 20, 4, 1);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 6:
                STGEngine.ShootAimed(rMainProjec, "Player", 10);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 7:
                //STGEngine.ShootAimedLeading(rMainProjec, "Player", 10);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 8:
                STGEngine.MoveTowards(new Vector2(0, 1), 1);
                AIFrames.EventMoveEnd(2.0f);
                break;

            case 9:
                STGEngine.ShootAroundSwirl(rMissileProjec, 20, 0.1f, 1, 1, false);
                AIFrames.EventMoveEnd(1.0f);
                break;

            case 10:
                AIFrames.EventMoveEnd(5.0f);
                break;

            case 11:
                AIFrames.EventMoveStart(2);
                break;
            }
        }

        //Destroyed
        if ((iHealth <= 0) && (bAlive))
        {
            aAudioSource.PlayOneShot(aDestroySound, 1.0f);
            STGEngine.ScoretoAddtoCounter(ScoreCounter.tScoreCounter, 5);
            bAlive = false;
        }
        if (!bAlive)
        {
            fDeathSpin             += 5f;
            rThisBody.bodyType      = RigidbodyType2D.Dynamic;
            this.transform.rotation = Quaternion.Euler(180, 0, fDeathSpin);
            gameObject.GetComponent <CapsuleCollider2D>().isTrigger = true;
            Destroy(gameObject, 1.0f);
        }
    }
示例#17
0
        protected override void Initialize()
        {
            base.Initialize();

            scene = new Scene1();
        }
示例#18
0
    void Start()
    {
        guiS3 = GameObject.Find("Main Camera").GetComponent<GUIS3>();
        clockBehaviour = guiS3.clockBehaviour;
        Debug.Log("clockb " + clockBehaviour);
        scene1 = GetComponent<Scene1>();
        scene2 = GetComponent<Scene2>();
        scene3 = GameObject.Find("Main Camera").GetComponent<Scene3>();

        company = GameObject.Find("Company");
        left = GameObject.Find("Left");
        bottomLeft = GameObject.Find("BottomLeft");
        extraBottomLeft = GameObject.Find("ExtraBottomLeft");
        top = GameObject.Find("Top");
        middle = GameObject.Find("Middle");
        bottom = GameObject.Find("Bottom");
        topRight = GameObject.Find("TopRight");
        right = GameObject.Find("Right");
        bottomRight = GameObject.Find("BottomRight");
        extraTopRight = GameObject.Find("ExtraTopRight");;

        terrain = GameObject.Find("HGVTerrain");
        //terrainHint = GameObject.Find("TerrainHint");

        //		time = 0;
        //
        startPosition = transform.position;
        startRotation = transform.eulerAngles;
        //
        //		initialRotation = 90;
        //		rotation = initialRotation;

        rotSecond = 3;

        moveAmount = 40;

        moveSecond = 0;

        nonDiagonalTime = 1;

        diagonalTime = Mathf.Sqrt(nonDiagonalTime * nonDiagonalTime * 2);

        //		clicked = false;
        //
        //		x = -40;
        //		z = 40;
        //
        //		xCounter = 0;
        //		zCounter = 0;
        //
        locationCounter = new int[2];
        //
        //		locationCounter[0] = 0;
        //
        //		locationCounter[1] = 0;

        arrivedLocation = new List<int[]>();

        //arrivedLocation.Add(new int[]{locationCounter[0], locationCounter[1]});

        scene = Scene.scene1;
    }
 public Scene1Data (Scene1 scene1)
 {
     RedKeyIsPickedUp = Scene1.RedKeyIsPickedUp;
     YellowKeyIsPickedUp = Scene1.YellowKeyIsPickedUp;
 }