package data {
import flash.events.EventDispatcher;
/**
* I REQUEST THAT ANYONE WHO USES MY CODE CREDITS "BLUE LIGHT" AND LINKS TO GNW SUB-FORUMS ON "LEGEND OF KRYSTAL". THIS IS A REQUEST, NOT A DEMAND.
* @author BlueLight
* @author Bit (I think)
*
* This class is designed to minimize the amount of code is required to maintain most stat variables.
* We will store 4 variables, a min, current and max; along with a boolean called goHigh. (Might want a better name for that variable.
* The current can not be below the min, or above the max.
*
* It will have at least 8 functions.
* Get: min, current & max. set:min, current & max. change current, restore current
*
*/
public class DynamicNumber extends EventDispatcher
{
public static const CHANGED:String = "changed";
public static const RESTORED:String = "restored";
public static const MINNED:String = "minned";
public static const MAXED:String = "maxed";
protected var _minimum:Number; // the min number that current can be.
protected var _maximum:Number;//the max number that current can be.
protected var _current:Number;//current or index number.
protected var _highest:Boolean;//if you restore method, this decides if you set current to maximum or minimum.
/**
* the function has a default value of 0 for min, and 100 for max. These are the values you're most likely going to use.
*/
public function DynamicNumber( min:Number = 0, max:Number = 100, current:Number = 100, high:Boolean = true )
{
//set the min and max values. We use Math.min, and Math.max incase the user messes up. Basically bug prevention.
_minimum = Math.min(min,max);
_maximum = Math.max(max,min);
_current = current;
_highest = high;
//there are designed checks and balances in these methods to make sure variables have the wrong value. Only reason for running all the values right now.
this.maximum = this.maximum;
this.minimum = this.minimum;
this.current = this.current;
this.highest = this.highest;
}
/**
* Minimum value of the dynamic number
*/
public function get minimum ():Number
{
return _minimum;
}
/**
* Maxiumum value of the dynamic number
*/
public function get maximum ():Number
{
return _maximum;
}
/**
* Current value of the dynamic number
*/
public function get current ():Number
{
return _current;
}
//returns boolean, highest.
public function get highest():Boolean
{
return _highest;
}
/**
* Minimum value of the dynamic number
*/
public function set minimum (min:Number):void
{
//checks to make sure min is more than Maximum.
this._minimum = min <= this._maximum? min:this._minimum;
}
/**
* Current value of the dynamic number
*/
public function set maximum (max:Number):void
{
//checks to make sure max is more than minimum.
this._maximum = max >= this._minimum? max:this._maximum;
}
/**
* Sets the current variable to a new value so unless it's above the max or below the min.
* If it's below the min, it will set the value to the min, or if it's above the max, it will set the value to the max.
*/
public function set current(value:Number):void
{
this._current = Math.max(this._minimum, Math.min(this._maximum, value));
}
//just a simple setter for changing highest.
public function set highest(high:Boolean):void
{
this._highest = high;
}
/**
* Adds an amount to the current value.
* @param value
*/
public function add(amount:Number):void
{
this.current = this._current + amount;
}
/**
* Restors the current value to either the max value if highest is true, or the min value if not.
*/
public function restore():void
{
this.current = highest ? maximum : minimum;
}
}
}
Terrantor!!! Wrote:Hey, blue. his game is written in as2, not as3, so he may need a translator.
Anonymouse Wrote:I'm not really sure what you mean by the tinting issue. It sounds like you are saying that if you want to tint x, and then you change what x is - not change what frame x is on or any property of x, but completely redefine what x refers to - it should keep the tint that the previous x had. That sounds awful, and there's also a really simple workaround - put x into a container, then modify the container. For example say you have three body shapes and you put each one on a frame, and want to tint each one, all you have to do is put those three frames inside a new symbol and tint the new symbol.
Also the issue with "best practices" seems a little redundant, as using AS2 is by no means considered a best practice either. Don't want to use best practices? Then don't. Stick your code on the timeline - it's not like the code police are going to arrest you, and this isn't a good reason to stop using AS3.
Terrantor!!! Wrote:Amazing Work! I see great potential for this model. Was wondering if you could chop a model up for me and make it animation friendly.
VintageBass Wrote:OK so I really can't say much in terms of the coding, there was one thing I wanted to say but I never did in my first post... the male has some hanging balls. Not that I'm complaining, having that is a good thing. Plus I don't really mind all that much that the male is using the same figure as the female/herm, considering that there are guys like that and hey why can't incubi look as good as their sister succubi?
Still I am excited about this. I would like to see more options, be it eye shapes, more bangs, breasts and cock sizes, whatever, and if you need help with that I'll be glad to provide. And maybe in writing as well, too... it does depend on what is going on after the character creation.
DomJoe Wrote:I love the color customization options, but I will voice Bass' sentiments as well: I'd like to see more hair options, more body options, just more physical options in general. Heck, some clothing options would be cool as well. Doesn't have to be complicated, but a little extra goes a long way.
Otherwise, love the art-style, and looking forward to seeing more.
BlueLight Wrote:Terrantor!!! Wrote:Hey, blue. his game is written in as2, not as3, so he may need a translator.
-_- people use AS2...... What madness is this!
-BlueLight; avid C based programmer.
Bad Idea Wrote:When it came time to make a male character, I was like "Oh, hell, why not turn the female character into a male character. Can I do that?" Turns out I could.
Bad Idea Wrote:So. Why are there herms in the game? Laziness.
Bad Idea Wrote:Why are there black people in the game? Laziness!
Bad Idea Wrote:Why male/male animations? They were male/female animations all along! I just slapped a couple more booleans into the character configuration code and there you go, you can play as a gay dude now if you feel like it.
Bad Idea Wrote:Having said all that, I have no idea what I'm doing here when it comes to drawing dudes. It is well outside my comfort zone and area of expertise. So if the balls look dodgy, you're doing me a favor by telling me they look dodgy. I won't learn anything if you start to say something but then back out and tell me it looks fine. I need to hear the entire comment. I can't guess the part left unsaid, because I might be thinking something completely different, or not thinking about the finer details at all. So the more complete the feedback you can give, the better. Paintovers would be great. I don't know about accepting staight-up content dumps from people because I was hoping to go full Patreon with this later if it starts to feel like I can actually finish it.
Bad Idea Wrote:Just to be clear, I definitely do plan on adding more eyelash and hair styles. Probably other body types, too. The character editor you see in the OP is meant as a technology test, not a catalog of all the possible options.
Bad Idea Wrote:Story comes later. I have a vague theme in mind, but that's as far as I'm taking the story until I have some gameplay working and refined to the point where it's fun.
VintageBass Wrote:perhaps about an eighth of the way up
Bad Idea Wrote:VintageBass Wrote:perhaps about an eighth of the way up
That's the part I needed to hear! Thank you very much.
Users browsing this forum: Google [Bot]