auma's Recent Forum Activity

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So how to wait for callFunction?

    My code continues without stopping.

  • 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?

auma's avatar

auma

Member since 13 Jan, 2021

None one is following auma yet!

Trophy Case

  • 3-Year Club
  • Email Verified

Progress

4/44
How to earn trophies