hat973 Wrote:to simplely put it
https://www.youtube.com/watch?v=sTDVY2xnFv8#t=171
Im fallowing this the guy uses a If or else if in his code is it posable to add a 3rd string to a else if statement
if(something==true){
doThis();
}else if(something==false){
doThat();
}else if(something==true && somethingElse==true){
doSomethingElse();
}else{
doNothing();
}
if (number == 5 || number > 3 && number <4.577584833 ) {...} //if number is 5, or above 3 and below 4.577.... the run this
else if (number == 4.577584833+ 0.3){...} //if number is equal to 4.877584833, run this
else if (A != B && (A&&!B)){...} // the A is not equal to be, and B is false along with A being true. It's confusing has this is set up but trust, A must be true and B must be false to run.
else if ( someRandomFunction() ){...}
else if ( 0 != 0){...}// this will never run but if it were, 0 must not equal to 0.
else{...}//None of the above statements true.
//bad design
//These are something you should not do.
if(myBoolean){...} // okay this will run if myBoolean is true.
if(!myBoolean){...}//this is the problem here. You are going to check both if statements are true, but [u]only 1[/u] can be true. What you should be doing for the second if statement is using "else if()" or a else statements. Both would work.
A = true;
number = !A == false? 1 : -1; // if NOT A is equal to false, number is equal to 1; else is equal to -1;
number = Math.Max(number, number>0? 20:-15); //if number is greater than 0, then Math.Max(number,20); else Math.Max(number,-15);
hat973 Wrote:I'm trying to figer out Time setting like Morning noon and night in a dating sim any way you guys may know this as2 if you are wondering what i'm asking iv poked around and haven't found much on the subject
//Assume hour is variable telling the current hour, and minute is telling the current minute upto 59.
return((hour==0)?12 :(hour%12)+1)+":"+minute+((hour/12 ==0)?AM:PM );//debug this yourself. It's just an example and i don't know if it will work correctly.
public function addSecond(value:Number):Number{
_second += value;
if(_second> 59){
addMinute(_second /60);
_second= _second%60;
}
}
public function addMinute(value:Number):Number{
_minute+= value;
if(_minute> 59){
addHour(_minute/60);
_minute= _minute%60;
}
}
public function addHour(value:Number):Number{
_hour+= value;
if(_hour> 23){
addDay(_hour/24);
_hour= _hour%24;
}
}
.............. more code..........
BlueLight Wrote:Can you be more clear on the question.
hat973 Wrote:I'm trying to figer out Time setting like Morning noon and night in a dating sim any way you guys may know this as2 if you are wondering what i'm asking iv poked around and haven't found much on the subject
Terrantor!!! Wrote:I believe your downBumper hitTest is not being satisfied. Trace its value by inserting the function " trace(downBumping) " into your loop function. If it keeps reporting false in your console, you need to revise your conditionals in the hitTest. Try making the y value higher and I'm sure you'll get your idle and run animations working.
Users browsing this forum: No registered users