Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Dec 01, 2014 at 04:26 PM by unimechanic for the following reason:

Question is off-topic or not relevant

avatar image
-1
Question by fariel2012 · Nov 28, 2014 at 08:30 PM · javascripterrorgamefunction

Incremental game need help

Hello guys,

I want to try to make a incremental game, like make it rain, or cookie clicker. I am learning unity few weeks as I go, catching whatever information I can get. But I need help with the scripts, because I can not find proper answers anywhere on the internet, I am often losing a lot of time by solving these. Please help me with few things :

Using javascript tho.

I got the background, graphic of the click thing set up, even the click counter alt text

So when I click the gem, Gems value increase by 1-that is done

  1. Next I would love to have a Gems Per second value under the Gems:xx But not sure how to break it down I guess counter with miliseconds and somehow display xx/s.

  2. I've got graphics for the "miner" that gives you certain amount of Gems per second, but I need help with scripting the process. So what I need : something like if gems == 50 gems -50 start routine gems+=1/s with increasing value of the gems for example first time its 50 then its 75(you get it) each time you buy it.

  3. "upgrade script" for changing the variable of gems per click from 1to lets say 3,6,9,20,100 etc(you know how these things works) Again this is in javascript, what I've got attached to the Blue Gem in the center :

      #pragma strict
         var clicks : Transform;
         var score: UI.Text;
         var clicked : boolean = false;
         var click : int = 0;
         function Start () {
         
         }
         
         function Update () {
         score.text = "Gems: " + click;
         }
         
         function OnMouseDown ()
         {
         click += 1;
         }
    
    
    

Thank you for your time guys !

screnshot.jpg (82.2 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HarshadK · Nov 28, 2014 at 11:43 AM 0
Share

So in short, you want us to develop your game for you? UA does not do that.

avatar image fariel2012 · Nov 28, 2014 at 11:44 AM 0
Share
 Ok So I might be up to the "Gem flow" Just need help with the part of buying the actual flow upgrade.
 
 InvokeRepeating("Increaseflow",0, 1.0);
 function Increaseflow (){
 click += 1;
 }
avatar image fariel2012 · Nov 28, 2014 at 12:51 PM 0
Share

No I do not want that, I just need poke in the right direction with those problems, hint lets say.

avatar image fariel2012 · Nov 28, 2014 at 03:03 PM 0
Share

Ok another problem I might need help with I made a script for "$$anonymous$$er" an gameobject next to the blue gem. when you click it, it should give you +2 gems every second, Which it does but only if I turn the BlueGem gameObject off

 #pragma strict
 var clicks : Transform;
 var score: UI.Text;
 var clicked : boolean = false;
 var click : float = 0;
 var Flow : float = 0;
 function Start () {
 
 }
 
 function Update () {
 score.text = "Gems: " + click;
 }
 
 function On$$anonymous$$ouseDown ()
 {
 
 click += Flow;
 animation.CrossFade("$$anonymous$$inerclicked");
 InvokeRepeating("Increaseflow",0, 1.0);
 }
 
 function Increaseflow (){
 click += Flow;
 }

can someone tell me what's interfering?

1 Reply

  • Sort: 
avatar image
0

Answer by unimechanic · Dec 01, 2014 at 04:26 PM

Please check the tutorials:

https://unity3d.com/learn/tutorials/modules

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Assets/Editor/UpdateTreeColors.js(13,17): BCE0031: Language feature not implemented: UnityEditor. 1 Answer

Why doesnt my script work 2 Answers

A node in a childnode? 1 Answer

Old school racer: can I do it in Unity? 1 Answer

Unexpected token: private. Error. Can anyone help? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges