Ignore:
Timestamp:
05/14/09 09:42:30 (11 years ago)
Author:
maximinus_parpg
Message:

Started incrementing object complexity.
Now you can map or non map objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/objects.py

    r68 r69  
    1818 
    1919class GameObject: 
    20     def __init__(self, xpos, ypos, ident, text): 
    21         self.xpos = xpos 
    22         self.ypos = ypos 
    23         self.id = ident 
    24         self.text = text 
     20    """Class to handle GameObjects""" 
     21    def __init__(self, data): 
     22        """Init is a little complicated becuase we have 2 types of 
     23           constructors in one function""" 
     24        if(data[0]==True): 
     25            self.xpos = int(float(i[1])) 
     26            self.ypos = int(float(i[2])) 
     27            self.gfx = i[3] 
     28            self.id = i[4] 
     29            self.text = i[5] 
     30        else: 
     31            self.xpos = None 
     32            self.ypos = None 
     33            self.gfx = i[1] 
     34            self.id = i[2] 
     35            self.text = i[3] 
    2536 
Note: See TracChangeset for help on using the changeset viewer.