Exemple #1
0
	// Use this for initialization
	void Start () {
		GameObject backgd = GameObject.Find ("background"); //调用脚本background中的地图
		bg = (background)backgd.GetComponent (typeof(background));

		GameObject moneyobj = GameObject.Find ("enemy"); //调用脚本background中的地图
		moneyscript = (money)moneyobj.GetComponent (typeof(money));
	}
 private void Start()
 {
     score     = FindObjectOfType <background>();
     button    = FindObjectOfType <buttons>();
     healthbar = GameObject.Find("health").GetComponent <Text>();
     health_check();
 }
Exemple #3
0
    public GameObject QuitButton;      //宣告QuitButton的物件


    // Start is called before the first frame update
    void Start()
    {
        Instance = this;         //指定Instance這個程式
        GameTitle.SetActive(true);
        GameOverTitle.SetActive(false);
        RestartButton.SetActive(false);         //RestartButton設定成不顯示
    }
        public static Boss boss;                                             //the main boss of the stage

        public level(Game Game, int sID)
        {
            stageID = sID;
            Console.WriteLine("started level");
            game = Game;

            player = new Player(game, this);

            manager        = new gameManager(game);
            manager.player = player;

            hud = new game_HUD(game, player);

            SpriteFont font  = game.Content.Load <SpriteFont>("fonts/small");
            Texture2D  pixel = game.Content.Load <Texture2D>("p");

            console = new DebugConsole(pixel, font, new Rectangle(1366 - 400, 0, 400, 0), game);

            camera       = new camera();
            camera.focus = player;

            player.cam = camera;

            bg           = new background(game);
            bg.reference = camera;

            sm = new ScriptManager(game, player);

            attackoverlay = new AttackOverlay(game);
        }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     score = FindObjectOfType <background>();
     StartCoroutine(new_wave());
     score.start_score();
     score.reset_score();
     Instantiate(Resources.Load("player", typeof(GameObject)), new Vector3(0, -3.5f, 0), Quaternion.identity);
 }
Exemple #6
0
 public void assignTo(background val)
 {
     attachment = val._attachment;
     baseurl    = val._baseurl;
     image      = val._image;
     repeat     = val._repeat;
     color      = val._color;
 }
Exemple #7
0
 void Start()
 {
     image       = GetComponent <Image>();
     groundSpeed = GameObject.FindGameObjectWithTag("Ground").GetComponent <background>();
     rb          = GetComponent <Rigidbody2D>();
     if (enemyOrWeed == EnemyOrWeed.enemy)
     {
         RandomSprite();
     }
 }
    void Awake()
    {
        //Store the number of sessions user has played the game
        launchCount = PlayerPrefs.GetInt("TimesLaunched", 0);
        launchCount = launchCount + 1;
        PlayerPrefs.SetInt("TimesLaunched", launchCount);

        //set our static reference to our newly initialized instance
        instance = this;
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        GameObject backgd = GameObject.Find("background");          //调用脚本background中的地图

        bg = (background)backgd.GetComponent(typeof(background));

        GameObject moneyobj = GameObject.Find("enemy");          //调用脚本background中的地图

        moneyscript = (money)moneyobj.GetComponent(typeof(money));
    }
Exemple #10
0
        public Tuple <double, string> Judge_sql(question q, background back, string ans)
        {
            string username = (string)Session["account"];

            ans = ans.ToUpper();
            if (ans == "")
            {
                return(new Tuple <double, string>(0, "空字符"));
            }
            if (ans.Last() == ';')
            {
                ans = ans.Remove(ans.Length - 1);
            }
            string back_name = back.name;
            var    res       = new Tuple <string, bool>("暂不支持该数据库", false);

            if (back.db == "Kingbase")
            {
                KingbaseConn conn = new KingbaseConn();
                res = conn.JudgeSql(username, q, ans, back_name);
                conn.Dispose();
            }
            else if (back.db == "Mysql")
            {
                MysqlConn conn = new MysqlConn(username);
                res = conn.JudgeSql($"Student_{username}", q, ans, back_name);
                conn.Dispose();
            }
            else if (back.db == "MSSQL")
            {
                MSSQLConn conn = new MSSQLConn(username);
                res = conn.JudgeSql($"Student_{username}", q, ans, back_name);
                conn.Dispose();
            }
            double score = 0;
            string exc   = "";

            if (res.Item2 == true)
            {
                score = q.totvalue;
                exc   = "congratulations!!";
                score = 10;
            }
            else
            {
                ans += "&exit";
                exc  = res.Item1;
                var Dic  = Server.MapPath("/flex");
                var path = Server.MapPath($"/flex/exe/question{q.id}.exe");
                score = double.Parse(tf.RunFlex(path, ans, Dic, username));
            }
            return(new Tuple <double, string>(score, exc));
        }
        public override void Initialize()
        {
            // TODO: Add your initialization logic here
            ranks = new RankManager();
            crosshair = new Crosshair(game.Content);
            h1 = new HUD();
            d1 = new DropBoxManager(game.Content);
            b1 = new background();

            cam = new CameraMan(new Vector2(0, 0));
            cam._pos.Y += service.GraphicsDevice.PresentationParameters.BackBufferHeight / 2;
            cam._pos.X += service.GraphicsDevice.PresentationParameters.BackBufferWidth / 2;
        }
Exemple #12
0
    // Use this for initialization
    void Start()
    {
        Bola       = GameObject.Find("Bola").GetComponent <bola>();
        obstacles  = GameObject.Find("ObstacleController").GetComponent <obstacleController>();
        cameraMain = GameObject.Find("MainCamera").GetComponent <cameraMove>();
        back       = GameObject.Find("BackgroundController").GetComponent <background>();

        deadCanvas.SetActive(false);

        pressSpaceT.SetActive(true);

        final   = false;
        running = false;
    }
Exemple #13
0
 /// <summary>
 /// HitPlayer: Called if the Goomba hit a Player object and proceeds to destroy it.
 /// <param name="col">Player Objects collider</param>
 /// </summary>
 public void HitPlayer(Collision2D col)
 {
     if (!HitTrigger)
     {
         background b = GameObject.Find("BackgroundAudio").GetComponent <background>();
         b.StopBackgroundMusic();
         aSource.PlayOneShot(aBump);
         col.gameObject.GetComponent <PlayerMovement>().allowMove    = false;
         col.gameObject.GetComponent <Rigidbody2D>().velocity        = Vector2.zero;
         col.gameObject.GetComponent <Rigidbody2D>().angularVelocity = 0f;
         Destroy(col.gameObject.GetComponent <CircleCollider2D>());
         Destroy(col.gameObject.GetComponent <BoxCollider2D>());
         StartCoroutine(WaitForRestart(col));
     }
 }
        public string CreateBackGround(background back)
        {
            var result = "";

            string[] sqls = back.sql.Split(';');
            try {
                KingbaseESCommand cmd = new KingbaseESCommand("CREATE SCHEMA " + '"' + back.name.ToUpper() + '"' + " " + sqls[0], conn);
                var res1 = cmd.ExecuteNonQuery();
                cmd.CommandText = "SET search_path TO " + '"' + back.name + '"' + ",public";
                cmd.ExecuteNonQuery();
                for (int i = 0; i < sqls.Count(); i++)
                {
                    cmd.CommandText = sqls[i];
                    cmd.ExecuteNonQuery();
                }
            }catch (Exception e) {
                result = e.Message;
            }
            return(result);
        }
Exemple #15
0
 void Awake()
 {
     I = this;
 }
Exemple #16
0
	public startscript stspt;//开始脚本
	
	// Use this for initialization
	void Start () {
		GameObject backgd = GameObject.Find ("background"); //调用脚本background中的地图
		bg = (background)backgd.GetComponent (typeof(background));
	}
Exemple #17
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
     Quit.SetActive(false);
     Restart.SetActive(false);
 }
Exemple #18
0
 public void BackgroundBlue()
 {
     backgroundcolor = background.Blue;
     PlayerPrefManager.setbackground("Blue");
 }
Exemple #19
0
 void Awake()
 {
     Currentstate    = Mainstate.MainMenu;
     backgroundcolor = background.Blue;
     PlayerPrefManager.setbackground("Blue");
 }
Exemple #20
0
 public void BackgroundRed()
 {
     backgroundcolor = background.Red;
     PlayerPrefManager.setbackground("Red");
 }
Exemple #21
0
    public startscript stspt;      //开始脚本

    // Use this for initialization
    void Start()
    {
        GameObject backgd = GameObject.Find("background");          //调用脚本background中的地图

        bg = (background)backgd.GetComponent(typeof(background));
    }
Exemple #22
0
 public void BackgroundGreen()
 {
     backgroundcolor = background.Green;
     PlayerPrefManager.setbackground("Green");
 }