Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Collider on January 17, 2014, 08:31:05 AM

Title: Enemy Hit Counter for High Score[SOLVED]
Post by: Collider on January 17, 2014, 08:31:05 AM
Hello :)

i’ve searched and read topics like http://hutonggames.com/playmakerforum/index.php?topic=1288.0 (http://hutonggames.com/playmakerforum/index.php?topic=1288.0)
But it’s not so easy and i hope you can help me:

I spawn enemies from the back that are moving. If i hit one of these enemies with an object, e.g. a cube, i want count 1 point for this action.

So what did i need? Global variables, a GuiText… and…? Can someone help me… possibly with screenshots?

Thanks in advance  :)
Title: Re: Enemy Hit Counter for High Score
Post by: Lane on January 17, 2014, 09:12:29 AM
 You probably want GUI Int Label and whenever an enemy it hit you send an event to increase the score int variable by 1. The GUI should be showing that iny and automatically update.
Title: Re: Enemy Hit Counter for High Score
Post by: Collider on January 18, 2014, 09:19:26 AM
Perfect, it works! Thanks for your help :)

Is it possible to store the High-Score after quit the game? I’m working with level load for a start menu. So it would be great to have the high score in this menu, also after quit this game.

Title: Re: Enemy Hit Counter for High Score
Post by: Lane on January 18, 2014, 09:30:03 AM
You'll need a Save solution from the asset store (i think there are some free ones too) or an XML solution for that.
Title: Re: Enemy Hit Counter for High Score
Post by: Collider on January 21, 2014, 11:41:19 AM
Thank you! One more question – how can i set the position of the score? It’s always upper left. And is it possible to change the font and height of the score?

The GUILayout Int Field have a Style-field… but i don’t know how to use it in playmaker…
Title: Re: Enemy Hit Counter for High Score
Post by: Lane on January 21, 2014, 11:50:49 AM
You'll need to use GUILayoutStart and GUILayoutEnd with any actions you want inbetween those two. Set the position with GUILayoutStart, you can observe the changes in Game View.

For custom fonts and such you have to setup a GUI Style with what you want and tell the GUI to use it.
Title: Re: Enemy Hit Counter for High Score
Post by: Collider on January 23, 2014, 12:12:21 PM
But how can i setup a custom GUI Style?
Title: Re: Enemy Hit Counter for High Score
Post by: Lane on January 23, 2014, 12:17:53 PM
http://docs.unity3d.com/Documentation/Components/class-GUISkin.html
Title: Re: Enemy Hit Counter for High Score[SOLVED]
Post by: Collider on January 27, 2014, 04:17:27 AM
Thank you so much :)