Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def __init__(self):
self.unitConfig = ConfigParser.ConfigParser()
self.unitConfig.read(self.mainConfig.get('main', 'unit_config_file'))

self.objectConfig = ConfigParser.ConfigParser()
self.objectConfig.read(self.mainConfig.get('main', 'object_config_file'))

self.loadConfigs()

def loadConfigs(self):
Expand All @@ -38,6 +41,7 @@ def isNumber(number): # Run for all, test to see if it is a number, and returns
self.user = {}
self.wall = {}
self.unit = {}
self.object = {}

for section in self.mainConfig.sections():
data = {}
Expand All @@ -62,6 +66,12 @@ def isNumber(number): # Run for all, test to see if it is a number, and returns
for option in self.unitConfig.options(section):
data[isNumber(option)] = isNumber(self.unitConfig.get(section, option))
self.unit[section] = unitClasses(data)

for section in self.objectConfig.sections():
data = {}
for option in self.objectConfig.options(section):
data[isNumber(option)] = isNumber(self.objectConfig.get(section, option))
self.object[section] = objectClasses(data)

print 'END OF PARSER.PY!'

Expand All @@ -77,6 +87,9 @@ def __init__(self, dictionary):#, name):
self.drillTime = dictionary['drilltime']
self.conductor = dictionary['conductor']
self.texture = dictionary['texture']
self.selectable = dictionary['select']
self.dynamite = dictionary['dynamite']
self.reinforce = dictionary['reinforce']

class unitClasses:
def __init__(self, dictionary):#, name):
Expand All @@ -92,3 +105,18 @@ def __init__(self, dictionary):#, name):
self.digMulti = dictionary['digmulti']
self.reinforceMulti = dictionary['reinforcemulti']
self.shovelMulti = dictionary['shovelmulti']

class objectClasses:
def __init__(self, dictionary):
self.pickup = dictionary['pickup']
self.eValue = dictionary['evalue']
self.oValue = dictionary['ovalue']
self.stableTime = dictionary['stabletime']
self.charge = dictionary['charge']
self.decharge = dictionary['decharge']
#pickup: yes
#evalue: 0
#ovalue: 0
#stabletime: none
#charge: energy_crystal
#decharge: none
11 changes: 7 additions & 4 deletions RR2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import gameMain
import stratCam
import fpsTest
import something2
#import something4

parserClass = Parser.Parser()

Expand All @@ -14,14 +14,17 @@

gameMain = gameMain.world(parserClass, mapLoaderClass, modelLoaderClass)

stratCam.CameraHandler(modelLoaderClass.mapX, modelLoaderClass.mapY,
stratCam.CameraHandler(parserClass, mapLoaderClass, modelLoaderClass, gameMain,
modelLoaderClass.mapX, modelLoaderClass.mapY,
parserClass.userConfig.getfloat("control", "scrollborder"),
parserClass.userConfig.getfloat("control", "zoominspeed"),
parserClass.userConfig.getfloat("control", "zoomoutspeed"),
parserClass.userConfig.getfloat("control", "zoommax"),
parserClass.userConfig.getfloat("control", "zoommin"))

#f = fpsTest.thirdPerson(parserClass, gameMain, mapLoaderClass, modelLoaderClass)
#s = something2.Nodes(mapLoaderClass, 10, 10)
#s = something4.grid(mapLoaderClass)
#s1 = something4.aStar(s.landMesh, mapLoaderClass)
#s1.moveTo((14,30))

run()
run()
10 changes: 8 additions & 2 deletions data/config/main.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
[main]
includes: None
tilesize: 64
testing_map: data\maps\converted\
testing_map: data\maps\ten\
wall_config_file: data\config\walls.cfg
unit_config_file: data\config\unit.cfg
user_config_file: data\config\user.cfg
object_config_file: data\config\object.cfg

[wall_types]
0: ground
Expand All @@ -29,4 +30,9 @@ user_config_file: data\config\user.cfg
11: recharge_seam

[units]
0: rockraider
0: rockraider

[objects]
1: energy_crystal
2: ore
3: empty_crystal
30 changes: 30 additions & 0 deletions data/config/walls.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ speed_coef: 1
drillTime: none
conductor: no
texture: data/models/world/textures/ground.png
select: yes
dynamite: 3
reinforce: none

[solid_rock]
fullName: Solid Rock
Expand All @@ -34,6 +37,9 @@ speed_coef: 0
drillTime: none
conductor: no
texture: data/models/world/textures/solidrock.png
select: no
dynamite: no
reinforce: none

[hard_rock]
fullName: Hard Rock
Expand All @@ -45,6 +51,9 @@ speed_coef: 0
drillTime: 10
conductor: no
texture: data/models/world/textures/hardrock.png
select: yes
dynamite: yes
reinforce: 3

[loose_rock]
fullName: Loose Rock
Expand All @@ -56,6 +65,9 @@ speed_coef: 0
drillTime: 4
conductor: no
texture: data/models/world/textures/looserock.png
select: yes
dynamite: yes
reinforce: 3

[dirt]
fullName: Dirt
Expand All @@ -67,6 +79,9 @@ speed_coef: 0
drillTime: 4
conductor: no
texture: data/models/world/textures/dirt.png
select: yes
dynamite: yes
reinforce: 3

[lava]
fullName: Lava
Expand All @@ -78,6 +93,9 @@ speed_coef: 1
drillTime: none
conductor: no
texture: data/models/world/textures/lava.png
select: no
dynamite: yes
reinforce: none

[ore_seam]
fullName: Ore Seam
Expand All @@ -89,6 +107,9 @@ speed_coef: 0
drillTime: 10
conductor: no
texture: data/models/world/textures/UNSET.png
select: yes
dynamite: yes
reinforce: none

[water]
fullName: Water
Expand All @@ -100,6 +121,9 @@ speed_coef: 1
drillTime: none
conductor: no
texture: data/models/world/textures/water.png
select: no
dynamite: no
reinforce: none

[energy_crystal_seam]
fullName: Energy Crystal Seam
Expand All @@ -111,6 +135,9 @@ speed_coef: 0
drillTime: 10
conductor: no
texture: data/models/world/textures/ecseam.png
select: yes
dynamite: yes
reinforce: none

[recharge_seam]
fullName: Recharge Seam
Expand All @@ -122,3 +149,6 @@ speed_coef: 0
drillTime: 4
conductor: no
texture: data/models/world/textures/UNSET.png
select: yes
dynamite: no
reinforce: none
12 changes: 11 additions & 1 deletion data/maps/ten/maps/Cror.map
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
22222222221111111111










1 change: 1 addition & 0 deletions data/maps/ten/maps/Reda.map
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added data/maps/ten/maps/Renu.map
Binary file not shown.
Loading