help me make a hidden object game
knightansbert7

im new to wade , kindly help me first make a welcome message and game menu . then lvl1 find 5 garbages in the river. with timer and score

Comments 76 to 90 (111 total)
Gio

> cannot read property 'getsprite' of undefined (sceneobjec, 

Sounds like you haven't created an object called lifePointsText before doing that...

knightansbert7

sir did u mean ill put this on timeline too 

_.lifePointsText.getSprite().setText(wade.app.lifePoints);
knightansbert7

sir i have thats why i dont understand

knightansbert7

sir i have thats why i dont understand

knightansbert7

i got objects - life

Gio

> sir did u mean ill put this on timeline too 

Yes

> sir i have thats why i dont understand

From that picture, it doesn't look right. It should look the same as your scoreText (i.e. a text sprite that shows "0"). Instead, it looks like a white box... that suggests that it wasn't set up correctly. For this object, you should follow the exact same steps that you used to create your scoreText object. The only difference will be the name.

knightansbert7

timeline

knightansbert7

sir is it possible to make 2 characters in 1 scene that fights? still waiting for your reply... need to finish before monday

knightansbert7

sir im interested with the space shooter game... im thinking that i want that to be my lvl3 ... the player is hte ship then the enemy ship will look like the garbage boss.. maybe coz the tutorials are missing like scores, lifepoints, and a game over scene... maybe u could jsut reply here sooo after my class i cud try to make that lvl3... but sir still the error about the lifepoints is not yet solved... sooo i will jsut wait for your reply thank you...

knightansbert7

Sir please online

foxcode

Okay
Gio posted this code a few comments back
 

--wade.app.lifePoints;
_.lifePointsText.getSprite().setText(wade.app.lifePoints);
if (wade.app.lifePoints === 0)
{
    wade.clearScene();
    wade.loadScene('gameOver.wsc');
}
return true;

and you posted
"cannot read property 'getsprite' of undefined (sceneobjec, "

Do you still have that problem, or have you got past that?

knightansbert7

same error sir

knightansbert7

should i rename the objects that when clicked it will be - lifepoints?

knightansbert7

can we go back on how to add lifepoints? 1st step 

foxcode

Okay, lets look at the pictures you linked

"timeline code.png"

In this image I can see you do wade.app.lifePoints = 3; That looks correct to me.

You then have some code to set the value of the text sprite. _.lifePointsText.getSprite().setText(wade.app.lifePoints);

 

I think that code should work. It should set the life to 3, then display that on screen where ever you have placed your text sprite, I cannot actually see it in the scene but I presume it's somewhere. 

You are telling me that it doesn't work, so we need to try and narrow it down a bit.

  1. Click on your lifePointsText object so you can see the properties.
  2. Make sure that addToScene button is orange. It is by default, but it may have been turned off somehow and this could cause the problem you are seeing
  3. Make sure you actually have an object called lifePointsText. It is possible your code has changed since you made these images
  4. Look at the sprites on the lifePointsText object. Make sure it has only 1 sprite, and make sure it is a text sprite.

If it still says "cannot getSprite() of undefined" something weird is going on and you might have to send me the code.

You can attach code the same way you attach images on this forum.  In wade, download the sourcecode of your project. You can do this by clicking the folder icon (yellow box with a green arrow near the top left) and then clicking source code. This will download a zip file. If you then attach that to your post, I will be able to see all your code and it will make it much easier for us to get it working :)

 

 

 

Post a reply
Add Attachment
Submit Reply
Login to Reply