help on a simple game

This is the place for queries that don't fit in any of the other categories.

help on a simple game

Postby Donovanx » Wed Jun 12, 2013 1:43 pm

Ok so I have my main plot al figured out and I have evrything in mind how I want the game to operate the only problem is I'm not expierienced enough to do it on my own wrighting expieriens so here's my problem.
I have a class from the help of "setrofim".
Code: Select all
class Character(object):
    def __init__(self, race, health, strength, defence, magic, agaility, ranged):
        self.race = race
        self.strength = strength
        self.defence = defence
        self.magic = magic
        self.agility = agility
        self.ranged = ranged
characters = [
    Character("Org", 100, 10, 10, 5, 8, 5),
    Character("Elf", 90, 8, 8, 10, 10, 12),
    Character("Templar", 120, 10, 12, 10, 5, 5),
]

But I have no idee on how to use it the way I want.
Exsample
You get to you your own char with his own stats from another clas with the same format as above called "orace"
And now I want to be able to mach the character wich the player chose against one of the npc's(the characters from the above class)agains each other to have a winner but I don't know how to mach them against each other and I don't know how to have constant print on the screen that shows the stats (like the health) that updates itself as the player progresses
Any idees on how I woud go about this?
Srry if I'm vague on wat I want tryd my best to explain it
Thank for reading and help!!!
Donovanx
 
Posts: 13
Joined: Fri May 10, 2013 1:54 pm

Re: help on a simple game

Postby Mekire » Wed Jun 12, 2013 2:19 pm

You will need to let the user select/generate his player and assign the computer a character. Then you're going to need a game loop (while). Presumably your user will be prompted to choose from some actions (attack/block/run/etc.). Then your NPC will choose its action (based on a sophisticated AI). Then you will calculate the outcome based on... whatever. Then print the results and loop.

Can't provide much advice other than that at this stage. Take some stabs at getting something working.
-Mek
User avatar
Mekire
 
Posts: 988
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: help on a simple game

Postby PurityLake » Wed Jun 12, 2013 5:49 pm

As Mekire pointed out already we can't hand out much advice at such an early stage but I can give you some advice.

1. Always plan game systems and mechanics
This is absolutely vital. There is no game without its systems and mechanics, be they premade systems and mechanics or custom it doesn't matter but you must know how you are going to integrate them to make the player feel as if he/she is affecting the game and not just the player pusing a button every now and again to do a few things.

2. PLAN PLAN PLAN
Couldn't make it more obivous, there is no game without planning. Make sure you have a good solid game designed before you do any programming. Research resources available to you, code bases that you can absorb or borrow ideas from and remember give all this time, not a day, not a week, but maybe a month of thought and research before you start typing that code

Give the two of these a go and you should have a pretty soild direction that you want to head in
PurityLake
 
Posts: 7
Joined: Wed Jun 12, 2013 5:26 pm


Return to General Coding Help

Who is online

Users browsing this forum: Crimson King, Google [Bot] and 4 guests