Be a Supporter!
Response to: Flash As2 Guide For Ai? Posted July 4th, 2009 in Game Development

The thing about AI is that there cant be a set guide made for it as its different for most games. The main thing to think about when making it is how would you want something to respond to a certain situation. Such as a fighting game, you would think about how a computer would use its attacks. If you think about everything thats needed you can prety much do it from there and its not all that difficult to do.

Response to: 2 swf's... Posted June 27th, 2009 in Game Development

As far as I know cookies are always accesses and written by the main swf doing all the loading and not by external files. I could be wrong - try it yourself and check your cookies folder for flash.

Response to: As2: Sim Game. Help!!! Posted June 27th, 2009 in Game Development

You obviously don't know how to script if you think Max Points = STR*10 as you can and never will be able to use spaces in variables.

It would be more like:

MaxPoints = STR*10;

He is right - you do need to learn the basics really.

Response to: Game Programmer! Paying $1000+ Posted June 18th, 2009 in Game Development

I'm also tempted to apply for it as I now have a lot of free time for the next few months. I'm competant in using PHP with MySQL and can get them to do more or less anything together and this kind of thing would be no problem for me to do. On the flash side of things would you be wanting it programmed in AS2, AS3 or is there no preference? Also would you be taking the .fla file after someone has created the flash as the developer would be paid for it?

Response to: Game Programmer! Paying $1000+ Posted June 18th, 2009 in Game Development

So basically flash is just a UI over the top of a PHP code that runs all the database type stuff? Also what other features will there be or is it just combat against other players like mybrute?

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

I might just have beaten your to it if I didnt forget 1 little line which resets some variables :P but good job on it. I will see what I get out of mine and post that.

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

Goto publish settings for your flash and change script time out to 999.

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

No I thought that at first but then realised that. It takes a lot lot longer to execute checking for all the digits now instead.

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

My script is considerably longer than that now - its approaching 200 lines but its a rushed job and messy :P

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

Ah ok I see. Well I made a script in flash that does finds 3 numbers with only 4 different digits for them. It took about 10 minutes to run (hence brute force) and now all I need to do is make it check that each use different numbers of that digit.

Response to: Brute force this enigma. Posted June 18th, 2009 in Game Development

Im trying this challenge aswell.

I dont really get what it means by 4 digits between them. Does it mean like it could be:

33122 53311 32215

or does it mean each number needs 4 different digits like:

41234 56785 74567

Response to: Skilled Flash Coder Wanted! Posted June 18th, 2009 in Game Development

I am quite interested in this and would like to code it but I would like to see maybe a small animation loop of some kind first maybe a walk loop or something :)

Response to: A bouncing script. Posted June 18th, 2009 in Game Development

That would not work the way he wanted it to*

Response to: A bouncing script. Posted June 18th, 2009 in Game Development

That would in the way I think he wants as it would not "bounce" back from the wall it would just stop dead by replacing its coordinate with its origional one.

Response to: # problem. Posted June 18th, 2009 in Game Development

The fla is a mess to be honest. You are better off instead of using loads of frames just using one frame with a dynamic text box to display another number in it. Then it can be stored as a simple variable and use accordingly.

Response to: A bouncing script. Posted June 17th, 2009 in Game Development

Well if you use the script I gave you for the wall bounces you can just set the SpeedX = -SpeedX and SpeedY = -SpeedY to change the direction the player will go.

Something like:

if (_root.Wall.hitTest(this._x, this._y, true)) {
    SpeedX = -SpeedX;
}

That wouldnt work very well but you get the idea of how to use it.

Response to: Holding off a script Posted June 17th, 2009 in Game Development

A counter is something like:

var Counter = 0;
var Something = false;

if (Something == true) {  // Set Something to equal true when you want the counter to activate
    Counter += 1;
}

if (Counter == 10) {
   // Do the function you want.
}

A timer interval uses real time instead of flash time so you can accurately measure seconds, minutes, hours etc.

You can use this as a timer:

function TimeFunction() {
    // Do something
}
IntervalOfTimer = setInterval(TimeFunction, 1000); // 1000mili seconds = 1 second

All you would do is set the setInterval off when your event happends and then remove it within the TimeFunction so it will only run once.

Remove with:

clearInterval(IntervalOfTimer);
Response to: Holding off a script Posted June 17th, 2009 in Game Development

Nope it dosent. Go make a counter or a timer interval to do it :)

Response to: Audio Desyncs At Export? Posted June 17th, 2009 in Game Development

When setting the audio to Event instead of stream it works much better. I'm not sure how that effects the overall movie though as to how you want it to work.

Response to: Weird Actionscript2 Problem Posted June 17th, 2009 in Game Development

If you dont know how many will be on stage at once then use the array method. It allows you to remove entries dynamically aswell while also keeping track of what is on stage.

The eval() basically sets a variable to something else. You could use this instead of eval():

Clip = eval("_root.Clip"+i);

_root["Clip"+i];

All it does is make the temporary variable Clip equal to that of each of your Clips individually. Just makes it easier than typing _root["Clip"+i] each time.

Response to: mouseX for mouse outside of Flash Posted June 17th, 2009 in Game Development

You would not be able to do this because if you move your mouse to the edge of the screen its value will stay as 0 and not change less than that. I found the code to check mouse that moves outside of the flash window and it is:

addEventListener(MouseEvent.MOUSE_OUT, RunFunction);
Response to: Weird Actionscript2 Problem Posted June 17th, 2009 in Game Development

Well if they are all generically named such as Clip0, Clip1, Clip2 and so on then you can run a for() loop to remove them:

for (i=0; i<TotalClips; i++) {
    Clip = eval("_root.Clip"+i);
    Clip.removeMovieClip();
}

Just change the TotalClips to the total amount of that clip you have and _root.Clip to the instance name minus the number as the i variable deals with the numbers.

If however you have not named them like that you should pass each movieclip into an array just as you would with normal data and you can then run the same for loop but instead like this:

for (i=0; i<MovieClipArray.length; i++) {
    Clip = MovieClipArray[i];
    Clip.removeMovieClip();
}
Response to: A bouncing script. Posted June 17th, 2009 in Game Development

This would require acceleration to make it look smooth such as:

onClipEvent (load) {
    Accel = 0.1;
    SpeedX = 0;
    SpeedY = 0;
    MaxSpeed = 5;
}

onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
        SpeedX -= Accel;
        if (Math.abs(SpeedX) >= MaxSpeed) {
            SpeedX = -MaxSpeed;
        }
    } else if (Key.isDown(Key.RIGHT)) {
        SpeedX += Accel;
        if (Math.abs(SpeedX) >= MaxSpeed) {
            SpeedX = MaxSpeed;
        }
    } else {
        if (SpeedX < 0) {
            SpeedX += Accel;
        } else if (SpeedX > 0) {
            SpeedX -=Accel;
        } else {
            SpeedX = 0;
        }
    }
    if (Key.isDown(Key.UP)) {
        SpeedY -= Accel;
        if (Math.abs(SpeedY) >= MaxSpeed) {
            SpeedY = -MaxSpeed;
        }
    } else if (Key.isDown(Key.DOWN)) {
        SpeedY += Accel;
        if (Math.abs(SpeedY) >= MaxSpeed) {
            SpeedY = MaxSpeed;
        }
    } else {
        if (SpeedY < 0) {
            SpeedY += Accel;
        } else if (SpeedY > 0) {
            SpeedY -=Accel;
        } else {
            SpeedY = 0;
        }
    }
    this._x += SpeedX;
    this._y += SpeedY;
}

That was typed off the top of my head so I dont know if it will work or not but it should.

Response to: mouseX for mouse outside of Flash Posted June 17th, 2009 in Game Development

Not it is not. But it is possible to detect when a mouse rolls outside of the flash window but i'm not sure what the code is for it.

Response to: I need coding help! Posted June 17th, 2009 in Game Development

Sorry forgot to say that should be within the onClipEvent (enterFrame) {} on the player movieclip.

Response to: I need coding help! Posted June 17th, 2009 in Game Development

This should work:

if (_root.door.hitTest(this) == true && Key.isDown(Key.DOWN) == true) {
     _root.nextFrame();
}
Response to: Plattformer ground hitTest? Posted June 17th, 2009 in Game Development

Dont forget that the x=0 and y=0 points need to be in the center of your movieclip otherwise the above code will not work as intended.

Response to: Stop locking shapes togeather Posted June 17th, 2009 in Game Development

Also when you click a tool you can click the little magnet icon on the toolbar to stop snapping and click it again to renable it.

Response to: Plattformer ground hitTest? Posted June 17th, 2009 in Game Development

It makes it output loads of "hits" because it dosent include the shapeflag. A regular hitTest just checks if the object is within the rectangle that can be drawn around the object whereas a shapeflag detects actual point to drawing collision.

Something such as this would be appropriate:

if (_root.Ground_MC.hitTest(this._x, this._y, true) {
         trace("hit"); // Do some function here to stop player passing through walls.
}
Response to: Saving issue Posted June 17th, 2009 in Game Development

The problem is because you are using spaces in your save global. You cant have spaces in a sharedobject file name. Replace them with underscores.