please put tutorial that bg music works
knightansbert7

Admins sorry for making thread again but,please put tutorial that bg music works on android... because my wc3.ogg is not working.. check my attachments. thank you . my final defense is on this day :(

Comments 31 to 45 (72 total)
knightansbert7

hey sir lifepoints is ok now.. but i dont know how if the score in drag item will get 10 it will open congratzMessage.. its deifferent in finding object true

knightansbert7

sir how to do it when the score in dragging items gets 10 it will visible the congratz message asap

Gio

If you have an object called congratzMessage and that object is initially set to be invisible, then where you do  _.scoreText.getSprite().setText(++wade.app.score); you could do this

 _.scoreText.getSprite().setText(++wade.app.score);
if (wade.app.score == 10)
{
    _.congratzMessage.setVisible(true);
}

 

knightansbert7

Where shud i put  that? 

Gio

where you do  _.scoreText.getSprite().setText(++wade.app.score);

knightansbert7

On my scoreText object  addtoscenefunction?

Gio

I believe you are doing that on the bin's onMouseUp function

knightansbert7

Uhhh thats where i got wrong.. I put if statement but i didnt put the get sprite.. I screwed up in debugging 😭

knightansbert7

if (wade.app.dragging)
{
    if (wade.app.dragging.type == this.type)
    {
       _.scoreText.getSprite().setText(++wade.app.score);
        wade.removeSceneObject(wade.app.dragging);

        wade.playAudio('correct.ogg');
        
 _.scoreText.getSprite().setText(++wade.app.score);
if (wade.app.score == 10)
{
    _.congratzMessage.setVisible(true);
}
    }
    else
    {
        // the wrong type was selected - display a message?
     wade.playAudio('its_' + wade.app.dragging.type + '.ogg');
     wade.removeSceneObject(wade.app.dragging);
     --wade.app.lives;
_.lifeText.getSprite().setText(wade.app.lives);

if(wade.app.lives === 0)
{
    wade.clearScene();
wade.loadScene('gameOver.wsc'); // I'm just clearing scene
    // No lives left, end game
    // restart or anything else you want
}
        
    }
}

 

i think theres something wrong?

Gio

Yes

Go back to what you had before. Just replace 

_.scoreText.getSprite().setText(++wade.app.score);

with the code that I posted above

knightansbert7

Go back to what you had before. <--- i dont understand sir 

Gio

You've just made a change and realized that it didn't work.

Go back to what you had before means "undo that change you've just made"

knightansbert7

if (wade.app.dragging)
{
    if (wade.app.dragging.type == this.type)
    {
       _.scoreText.getSprite().setText(++wade.app.score);
        wade.removeSceneObject(wade.app.dragging);

        wade.playAudio('correct.ogg');
        
    }
    else
    {
        // the wrong type was selected - display a message?
     wade.playAudio('its_' + wade.app.dragging.type + '.ogg');
     wade.removeSceneObject(wade.app.dragging);
     --wade.app.lives;
_.lifeText.getSprite().setText(wade.app.lives);

if(wade.app.lives === 0)
{
    wade.clearScene();
wade.loadScene('gameOver.wsc'); // I'm just clearing scene
    // No lives left, end game
    // restart or anything else you want
}
        
    }
}

 

this code works but no if wadeapp score===10 set congratzmessageVisible

Gio

Right, now you've gone back to what you had before...

 Just replace 

_.scoreText.getSprite().setText(++wade.app.score);

with the code that I posted above

knightansbert7

if (wade.app.dragging)
{
    if (wade.app.dragging.type == this.type)
    {
 _.scoreText.getSprite().setText(++wade.app.score);
if (wade.app.score == 10)
{
    _.congratzMessage.setVisible(true);
}
        wade.removeSceneObject(wade.app.dragging);

        wade.playAudio('correct.ogg');
        
    }
    else
    {
        // the wrong type was selected - display a message?
     wade.playAudio('its_' + wade.app.dragging.type + '.ogg');
     wade.removeSceneObject(wade.app.dragging);
     --wade.app.lives;
_.lifeText.getSprite().setText(wade.app.lives);

if(wade.app.lives === 0)
{
    wade.clearScene();
wade.loadScene('gameOver.wsc'); // I'm just clearing scene
    // No lives left, end game
    // restart or anything else you want
}
        
    }
}

 

 

correct?

Post a reply
Add Attachment
Submit Reply
Login to Reply