Thread: Creation of object in game

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User bobbinator's Avatar
    Join Date
    Jul 2009
    Posts
    29

    Exclamation Creation of object in game

    Hi everoyne

    I understand about how classes work but i have an issue with creating new objects. In my game i want to read a file which has level data. No problem.

    What i want to do is make a number of enemies that the file determins and then sets their attributes. So if my file said 10 goblins the program would make 10 seperate goblins. Would their names be enemy.goblin1, enemy.goblin2..... enemy.goblin10

    How do i tell the difference between two goblins????

    The only way i could think was to hard code the levels, that i dont want to do!. I want to beable to choose how many goblins there are and their attributes from an external file. Is it done with a loop like:

    Code:
    do 
    {
    
    "create new goblin"
    "set attributes"
    i ++
    
    }(while i <= number of goblins)
    thanks
    Last edited by bobbinator; 04-05-2011 at 05:38 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [freefps]Tactical Assault coders needed
    By Sickmind in forum Projects and Job Recruitment
    Replies: 4
    Last Post: 05-07-2010, 05:06 PM
  2. Replies: 15
    Last Post: 10-20-2009, 09:39 AM
  3. Making a script language?
    By Blackroot in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 02:22 AM
  4. game creation questions
    By ajrillik in forum Game Programming
    Replies: 4
    Last Post: 08-10-2005, 06:29 PM
  5. Replies: 7
    Last Post: 03-10-2004, 04:10 PM

Tags for this Thread