Thread: Base Numbers

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    25

    Base Numbers

    Okay frist things frist. I am making a Text based game and need some answers. I have created a formula for hit points for races. here is the code,

    Code:
    player.BaseHitPoints = (50 * 3) / 2;
    this is = to 75. Now what i am wondering is when i do the level up system would it read 75 + new hit points? is so is there a way where i can turn 50 into "x" and keep * 3 / 2? where x replaces 50 and the new hit points replace it.
    Last edited by Gardul; 09-29-2005 at 10:55 AM. Reason: left out a few words

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    What you have it just a constant not really a formula for base hitpoints. So maybe you should just assign base hit points to whatever the value is (75 in your case) in the constructor, and then change the hitpoints upon level up with an actual formula.

    Code:
    player.HitPoints = (player.Level * 3) / 2;
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about random numbers
    By Kempelen in forum C Programming
    Replies: 2
    Last Post: 07-02-2008, 06:28 AM
  2. Help with Rational Numbers (C++)
    By cloudjc in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2008, 04:03 PM
  3. Big Numbers (Base 256)
    By Epo in forum C++ Programming
    Replies: 10
    Last Post: 11-18-2004, 05:54 PM
  4. How do you represent non-integer base numbers?
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 04-08-2004, 01:09 PM
  5. converting numbers from one base to another
    By partnole in forum C++ Programming
    Replies: 4
    Last Post: 10-04-2001, 12:29 PM