Wednesday, August 27, 2008

Update

I've done my proposal, and I'm now working on that demo I released earlier. I've added a nice menu, a few decorations and some extra items to pick up. Right now I'm working on the inventory system which is pretty code-intensive, I enjoy the heavier coding but unfortunately it leaves me with little to talk about. So here's a little something I've been working on, I'm definitely wanting to put this character into the game at some point,

4 comments:

Roger Stack said...

What a great character!

Is coding the inventory system presenting any problems/challenges that you can describe?

bug said...

@ roger, coding like this is notoriously boring, complicated and annoying, and somehow I enjoy it. But further details would only cause headaches

Roger Stack said...

That's OK I've done heaps of coding so you can hit me with one or two of your fav bits :-)

bug said...

@ Roger I was thinking of non-coders, I don't want to be liable if my blog causes brain trauma, but since you asked so nicely this is the script that runs when you use one item to activate another:
import GameLogic
cont = GameLogic.getCurrentController()
scene = GameLogic.getCurrentScene()
sensor = cont.getSensor("sensor")
sensor1 = cont.getSensor("sensor1")
obj = cont.getOwner()
name=obj.getName()
if sensor.isPositive() and sensor1.isPositive():
for obj1 in scene.getObjectList():
if obj1.getName() == obj.unlocker:
if obj1.selected==1:
obj.locked = 0
obj1.got = 0
GameLogic.itemSel = 0
GameLogic.itemList[obj1.slot] = 0
if GameLogic.itemList[obj1.slot+1] != 0:
for i in range(0,6-obj1.slot,1)
'script to fill space once an item is removed from inventory'
for obj2 in scene.getObjectList():
if obj2.getName() == obj.prize:
obj2.got=1
obj2.slot=GameLogic.slotsFilled
GameLogic.slotsFilled+=1
obj2.setPosition([-.62+.379*obj2.slot,-50.425,2.252+obj2.slot*.036])
GameLogic.itemList[obj2.slot]=obj2.index
print GameLogic.itemList

Still wrestling with inventory management