Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mradebe_eti

Pages: [1] 2
1
Support / Re: Help with Level Unlock System
« on: November 14, 2013, 03:47:00 am »
How do I actually reference the sprite?

Here is my code:

Code: [Select]

tk2dBaseSprite test1 = new tk2dSprite();  //instantiating sprite object 
    test1.SetSprite("Skill 1 Icon Uncleared A");  // giving it a name of the game object
test1.enabled = false; // disabling it so users cannot tap on it

Is this correct? If not, how can I access the sprite, set the sprite and disable the sprite? Or replace it with another sprite which is disabled?

2
Support / Re: Text Alignment Issue
« on: October 30, 2013, 02:16:17 pm »
I'm drawing it as GUIText.

3
Support / Re: Text Alignment Issue
« on: October 29, 2013, 07:12:39 pm »
The values for Time and Score are not correctly aligned. They should not clip over any other text or the end of the screen (as per the screenshot). The weird thing is that the text does not have the same issue when viewing the scene within Unity.

4
Support / Help with High Score System
« on: October 29, 2013, 03:09:24 am »
Hi,

I need help setting up a high score system. I only want to save the current best score and time for each stage. These would need to show on the results screen as well as the high score screen.

I have attached screenshots where they would need to be displayed.

Any assistance is greatly appreciated.

Thanks.

5
Support / Text Alignment Issue
« on: October 29, 2013, 03:02:02 am »
Hi,

I've got a text alignment issue. The scene's in Unity show the screens with the correct alignment, but whenever I test them on the iPhone, the text is always incorrect. I have attached 2 screenshots with the alignment issue.

Is this a 2D Toolkit version problem? What can I do to fix the issue? And is there any code I can use to fix all the affected screens, instead of manually fixing each one?

Any assistance is greatly appreciated.

Thanks.

6
Support / Re: Help with Lives System
« on: October 10, 2013, 10:00:46 pm »
I just figured out your comment. I placed an if statement because I wanted it to decrease the player's lives once they reached level 8 and they did not score the required amount of points.

7
Support / Re: Help with Level Unlock System
« on: October 10, 2013, 09:56:40 pm »
Thanks for that.

Do I also need to place all the sprites I'm going to use in the hierarchy before I can use them? Or should I just reference them from their sprite collection?

8
Support / Re: Help with Lives System
« on: October 09, 2013, 09:03:36 pm »
I forgot to turn off emoticons when posting. It's supposed to be at level 8.

9
Support / Help with Level Unlock System
« on: October 08, 2013, 09:24:10 pm »
Hi,

I need help with creating a level unlock scene with 2D Toolkit. I tried following the tutorial on the thread below, but it was not very helpful to me.

http://forum.unity3d.com/threads/146955-Unity-Level-Unlocking-System-Using-PlayerPrefs

I have attached a screenshot of my scene.

I have 9 levels. The game starts with 3 unlocked levels (shown as blinking animated sprites). After completing the 3 levels (in any order) I need the levels to change (now shown as static sprites with a blue sphere) and then unlock 3 more levels which change color when completed, before unlocking the final 3 levels and completing the game.

I have created all the sprites. Do I need to layer the different sprites on top of each other like in the above tutorial? Should I have a separate script for each level or one script which controls everything?

Any assistance with this is appreciated.

Thanks.



10
Support / Re: Help with Lives System
« on: October 08, 2013, 07:34:21 pm »
I tried your suggestion to use the 2dUITextMesh and it still is not working.

Here is my script that I attached to the the TextMesh. I'm not sure where I'm going wrong.


Code: [Select]
using UnityEngine;
using System.Collections;

public class Lives : MonoBehaviour {

public int startingLives = 3;
    public static int curLives;
public tk2dTextMesh livesMesh;

void Start ()
{
curLives = startingLives;
livesMesh.text = "Lives    " + curLives.ToString();
livesMesh.Commit();

   }

void OnLevelWasLoaded(int level)
{
if (level == 08)
{
if (Score.score < 1500)
{
  curLives--;
livesMesh.text = "Lives    " + curLives.ToString();
livesMesh.Commit();
}
            if (curLives < 0)
{
  print ("Game Over!");
                livesMesh.text = "Game Over!" + curLives.ToString();
livesMesh.Commit ();
            }
}
}
}

I appreciate the assistance.

11
Enabling meta files worked!

Thank you  :)

12
Hi,

I built a 2D Toolkit Unity project for Android on my PC and then I copied the project onto a Mac (with the intention of switching it to an iOS project). When I open the project through Unity nothing shows up on both my Scene and Game windows, even though all the files are present.

What is the cause of this issue? Do I need to purchase 2D Toolkit for the Mac machine for me to view it? What should I do to fix it?

Thanks.

13
Support / Re: Help with Lives System
« on: September 20, 2013, 06:36:24 pm »
I'm saying the character sprite for my lives does not change when a life is lost. So it never get's to the point where a player has zero lives and the "Game Over" text can be displayed.

14
Support / Re: Help with Lives System
« on: September 20, 2013, 02:54:15 am »
Hi,

My mistake for not being clear. I'm having trouble with getting the sprites representing my lives to function with the script I wrote.

I also made the curLives check a separate if statement, but it still doesn't seem to work. Do I need a part of the script saying to change the sprite when lives decrease?

   public int startingLives = 3;
   public static int curLives;
   
   // Use this for initialization
   void Start () {
      curLives = startingLives;
      guiText.text = "Lives: " + curLives.ToString();
      guiText.material.color = Color.black;
   }
   
   void OnLevelWasLoaded(int level) {

         if (level == 08)

            if (Score.score < 1500) {
 
                  curLives--;
         }
            if (curLives < 0) {
 
                  print ("Game Over!");
               guiText.text = "Game Over!" + curLives.ToString();
               guiText.material.color = Color.black;
            }
   
   }
}


15
Support / Help with Lives System
« on: September 18, 2013, 08:31:57 pm »
Hi,

I need some help with getting my script to work for my lives system. I have already created 4 sprites showing all 3 lives to 0 lives. I need the player to lose a life if they score below the required amount of points (1500pts) or if they run out of time. This is what I have so far...can anyone help?

public class Lives : MonoBehaviour {

   public int startingLives = 3;
   public static int curLives;
   
   // Use this for initialization
   void Start () {
      curLives = startingLives;
   }
   
   void OnLevelWasLoaded(int level) {

         if (level == 08)

            if (Score.score < 1500) {
 
                  curLives--;
         }
         else if (curLives < 0) {
 
                  print ("Game Over!");
               guiText.text = "Game Over!" + curLives.ToString();
               guiText.material.color = Color.black;
            }
   
   }
}

Any help is appreciated.

Thanks :)

Pages: [1] 2