Lucky Day's Wizard War! for Android development thread
View Single Post
November 12th, 2012, 01:17
ok, last day before I start my regular job
This past week was spent trying to work out the inventory system. At first I developed a LinkedList and tried to store the items there but it kept crashing. I think the issue is I have instantiated the items on the list - a similar issue exists with arrays in Java I found out the hard way - but I don't know how to correct it. Its not like you can go through each item on an empty list!
So instead I've set the inventory to an array if my custom Item class instead. Weapons and Armor are subclasses of Item - probably scrolls will be later too.
The main issue with inventory is having to get it to work between three activities. A little research found where I can get a result back to parent activity from the child. This allows me to store the player variables from the child activity and then reload them in the parent. This is a good thing.
I was able to equip a new weapon in the Camp Activity so after I had to figure out how to get a drop list in multiple choice after I defeat a monster. Well I managed to do that but had some problems reading the selected. I eventually figured that out.
So now I am able to equip my enemies weapons that they drop. For the first time I am able to kill Skeletons.
For the first time this thing is just barely turning into a real game. I've even got my first design/strategy idea:
The skeletons are so much tougher than the player at first level the best thing to do is take out the Kobold or Goblin for their weapon, and then maybe, just maybe they may be able to take out the Skeleton for its sword.
In the meantime I've also added some nifty images for the weapons during an attack.
the sling was from a medieval painting depicting a battle - some of the background was painted with lapis lazuli. the others were modified public domain line art.
I still want to go to a linked list however. The prospect of creating a manual LL out of the array would just be a pain.
This inventory addition has made my loading and storage of the player variable more consistent across activities. I had hoped to make them into single class methods so all the need is a single update in true OO form but they give me fits when I add them to a custom class.
I can't seem to pass back the party object or somesuch - so its a bit of copying and pasting the same methods between activities. I don't have a lot of Activities so its not that difficult.
Developer of The Wizard's Grave Android game. Discussion Thread:
Last edited by Lucky Day; November 12th, 2012 at
Join Date: Oct 2006
Location: The Uncanny Valley
Mentioned: 3 Post(s)
View Public Profile
Send a private message to Lucky Day
Find More Posts by Lucky Day