auma's Forum Posts

  • 4 posts
  • I want one object control [MagicName = "ice"]. but, [set visibility invisible Microphone] all Microphone invisibility.

    Please help me. Thank you.

  • How do I check if this is asynchronous?

  • So how to wait for callFunction?

    My code continues without stopping.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • async battleStart(){
    		this.f_runtime.globalVars.isAttack = true;
    		var tempHp = this.f_runtime.globalVars.hp;
    		var tempEnemyHp = this.f_runtime.globalVars.enemy_hp;
    		
    		for(var i = 0; i < 20; i++){
    			// 0.1초마다 상대체력의 5%의 데미지를 받는다...
    			this.f_runtime.globalVars.hp -= tempEnemyHp/20;
    			this.f_runtime.globalVars.enemy_hp -= tempHp/20;
    			if(this.f_runtime.globalVars.hp <= 10) {
    				await this.f_runtime.callFunction("warningHp");
    // 				await sleep(2000);
    			}
    			if(this.f_runtime.globalVars.hp <= 0 || 
    			 this.f_runtime.globalVars.enemy_hp <= 0) {
    				this.f_runtime.callFunction("endBattle");
    				break;
    			}
    			await sleep(100);
    		}
    		this.f_runtime.globalVars.isAttack = false;
    		
    	}

    runtime.callFuntion Even if waiting, it will proceed. What's going on?

    Can you help me?

  • 4 posts