Thread: How do i put scores in my game?

  1. #1
    Anonymous
    Guest

    How do i put scores in my game?

    So far I know how to make my little actor run around, and inetract with another, but how do I put a score counter in my game?

  2. #2
    Anonymous
    Guest
    Sorry, INTERACT

  3. #3
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Well, since you haven't told us what API your using I'll keep my answer generic enough to cover the basics. Have an int variable (or long, depends on how your scored is incrimented and what you'd expect the highest allowable score to be). Initiate this variable to 0 at the beginning of the game, and then incriment or decriment it based on the player's success/failures.

    If you're using a Window's OS you can use GDI's TextOut, convert the score to a char string and then blit it to the screen. Just make sure you release the DC that you grab to write it to.

    Of course, the GDI can be slow, so you'd be better off writing your own text blitting class. It's actually really simple. You just need a bitmap of the font you want, a surface to hold it, a char string to hold your text and functions to initialize it, update the text, blit it and finally clean it all up. PM me if you need more info own writing your own.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# - Building a SCUMM-like game.. questions
    By Iyouboushi in forum Game Programming
    Replies: 0
    Last Post: 05-24-2008, 10:54 PM
  2. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  3. Game Programmer's AIM Circle: Join Today
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 12-20-2003, 12:12 PM
  4. How to (let the code) put an object into a game.
    By FromHolland in forum C++ Programming
    Replies: 5
    Last Post: 04-10-2003, 03:44 AM