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 May 08, 2013 at 10:45 PM by AlucardJay for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by jtcc34 · Dec 21, 2012 at 07:13 PM · javascriptrpg

how dose this script look?

hey I made this javascript in unity for my game that is a online rpg I have three classes this is for my warrior class the other two will have the same stat names but will have different stats. So if someone can look this script over and tell me if I need to change a line or two?

 var name : String;
 var level : int;
 var curExp : int;
 var maxExp : int;
 var buff : int;
 
 
 
 
 var health : int;
 var energy : int;
 
 var might : int;
 var defense : int;
 var magic : int;
 var luck : int;
 
 
 
 
 function Update() {
     
     
     BaseStats();
     Vitals();
     AddEXP();
     LevelUp();
 
 }
 // These are his stats for the game
 function BaseStats()
 {
     level = 1;
     curExp = 0;
     maxExp = 100;
     buff = 0;
 
     might = 75;
     defense = 80;
     magic = 25;
     luck = 41;
 
     
 }
 
 // These are his Vitals
 function Vitals()
 {
     health = 100;
     energy = 100;
 
 }
 // exp to add to this class 
 function AddEXP()
 {
     var exp : int = 1;
     curExp += exp;
 
 }
 
 // to level up the player
 function LevelUp()
 {
     if(curExp >= maxExp)
     {
         level++;
         maxExp += 10;
         
         might += 4;
         defense += 5;
         magic += 2;
         luck += 2;
         
         curExp = 0;
     
     }
 
 }
 
 

Comment
Add comment · Show 2
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 AlucardJay · Dec 27, 2012 at 01:13 PM 0
Share

Way too many questions. Better of posting this in this in the forums : forum.unity3d.com

Before I realized you wanted turn-based, I wrote this :

Where did you see an RPG tutorial in JS ?! All I know of is BergZerg Arcade : http://www.youtube.com/playlist?list=PLE5C2870574BF4B06

http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html

avatar image ExTheSea · May 08, 2013 at 08:07 PM 0
Share

This question shouldn't exist anymore. Someone with more karma should close it.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

rotation won't work someone please help? 0 Answers

Sstop the car on reaching finished line [Problem 0 Answers

A node in a childnode? 1 Answer

accessing a variable from one script in another with Unity 1 Answer

combat grid not working 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