Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Tuesday, February 28, 2012

Progress on the Drag and Drop Interface

Warning, mostly code design talk ahead.
I've been tinkering away at the Drag and Drop issue and I've designed a form of a solution. While I can't give any screen shots at the moment, I can at least explain the theory of the interface. The Drag and Drop system is split into 4 separate objects, a "Drag Manager", "Drag and Drop Object","Drag Target", "Drop Target". Drag and Drop Targets are properties of a "Drag and Drop Object" which is managed through the manager. The Target objects act as containers that can hold any graphic or button item  and behave as their own original type (such as a button), but also carry the dragging drop ability. The other important feature is to create cues for the player to understand the drag drop interface exists. When the player begins the drag the potential targets will stand out with a highlight. Once the drag is complete the highlights disappear.

If anyone has ever worked with flash, there is a native dragTarget feature for Movie Clip objects. However,  that pre-made solution isn't enough to deal with the craziness I require. When ever you use that feature, it glues an object to your mouse. I need to be able to take that object and make sure it is visible at the top most display layer, can access collisions from objects on other layers, and then become an entirely different object as soon as the player lets go.

I feel like I've gone a bit rambley with this explanation but it seems to be working so far. Tomorrow I should have something visible and work out the kinks.

Saturday, December 3, 2011

Working on Engine Revamping

I did a stream for the 2 - 3 hours I was working. Next time I'm working I'll plop another posting with a notice and link. Later I'll update with the work/change logs.

This time around I got to reworking the engine shortfalls I had. I was mostly rewriting some of my screen management code to make better use of the shared objects that will span the various game screens such as the primary dialog box, alert notifications, and help text boxes.

The next primary goal would be to create the interactive features such as buttons and drag and drop interfaces, that have all the bells and whistles that the default flash code just doesn't provide.

It may sound like I'm doing a lot of stuff all over again, but I have the benefit of the previous code to compare and improve. So hopefully things go through fairly smoothly. I may try to get another stream in Sunday evening, or at least Monday afternoon.

Thursday, September 29, 2011

Working on activity selection and other interfaces

My Livestream is now Over.

I've managed to figure out the bug as to why my activity buttons were not accessible. It had to do with a layer issue with an invisible object covering the buttons. Go figure. I'm going to have to reorganize how I'm passing arguments between my click events as its getting to be a pain to manage. I'll most likely figure this out outside of a stream as I imagine it's boring as hell to watch me figure out.

In other news, I've speced out my cow girl weight and figure system that will use a slight modification of my old weight system from my previous game. It will deal with a calorie system that calculates how many calories a character consumes/burns in a day and would modify them at the start of the following day. So that will be interesting to see in action.

I will most likely not be streaming until next week Thursday or Friday but I'll keep updates coming if I find time on the side.

Wednesday, August 17, 2011

Working on XML System and Stuff to Come.

I've been pretty busy with other commitments at the moment but I wanted to share a bit about my tests with XML.  It is looking pretty fantastic right and I plan on dumping a ton of effort into using it as a primary engine component for storing the majority of the game's data. The idea is to steer away from hard coding much of the expandable features of the game such as items, events, flags, attributes, effects, etc and use robust wrappers to account for all the sort of random things a developer would want to make. Want to create a quest line where you can find the legendary potion of the fertility goddess? You will be able to set up a series of events that can land you the rare potion item that gives entirely new attributes or effects that cause your character to grow in any numerous ways. Certainty you can be more creative that that, but that's the goal with this system.

For those inclined, here's a sample of what an item may look like in xml.


<item name = "apple">
<type>food</type>
<price>10</price>
<icon>apple.png</icon>
<effects>
<effect>targetCow.Health + 10</effect>
</effects>
<description>
A delicious red fruit. Known for keeping medical staff at bay.
</description>
</item>

You will be able to add numerous effects as well as custom ones by adding entries into a separate xml file for effects. I'll try to provide a guide for using this stuff once it gets there.

While this XML stuff is great, I'm currently stuck on writing much of the complex parsers needed to read all this random bit of information. I'm knocking my head against the wall a bit, but I've managed to find an opensource string to math expression parser made just for Actionscript 3.0. I also rediscovered something called "RegExp" or Regular Expressions, something I used for finding and replacing specific text in my last game. Apparently it's much more powerful (and convoluted) than I originally thought, and may prove useful to this part of the engine.

Once this is all taken care of, a HUGE part of the game will be done. Still, it will still be time before I start grabbing alpha testers as I haven't even begun getting any actual interfaces yet. Hopefully that will also mean more previews and less walls of text. Time will tell. And if you actually read this far user, I thank you with this awesome image below.


Milk Maid by Gunneko on Pixiv