Recent posts by Kyouhen on Kongregate

Flag Post

Topic: Game Programming / Hit Testing an Array (Solved)

OKAY THEN.

So I’m an idiot. Thanks for requesting more code, I ended up finding out what the problem was while I was halfway through copying it over. I had put the arr = new Array() line inside the loop that was adding enemies to it. So I was ending up with 5 arrays of 1 enemy instead of 1 array of 5. >_<

Thanks alot for the help, now I can move on.

 
Flag Post

Topic: Game Programming / Hit Testing an Array (Solved)

Yes, I’m using the push function to add new enemies to the array. The hitTestObject function is one I’m calling on the MovieClips in the array, I didn’t create it myself. I also tried calling the hitTestObject of the object colliding with the array, and still got the same results. My declarations and whatnot should be fine as everything I’ve put in the array is appearing on the screen and moving around like I want it to. I just can’t seem to get more than one of them to detect when they’ve been bumped into. :S

 
Flag Post

Topic: Game Programming / Hit Testing an Array (Solved)

So I have an array of Movieclip objects that I need to run a hit test against another Movieclip. Currently what I have looks something like this:

private var arr:Array;
private var clip:Movieclip;
private var time:Timer;

...
class declarations, populating arr with Movieclips, etc
...

private function timeHandler(e:Event) {
for(var i:int = 0; i < arr.length; i++){
arr[i].hitTestObject(clip);
}}

The problem I’m having here is that only one of the objects in the array is doing the hit test properly, the rest don’t seem to work at all. I also tried using the array’s built-in foreach() function, but got the same results. Does anyone know why my array will only test against the one Movieclip inside it, or does anyone know a better way to track an unspecified number of objects on the screen and test for collisions against each one?

Note that I don’t have the Flash IDE, I’m using Flash Develop. So any suggestions need to be functional entirely through AS3.

 
Flag Post

Topic: Game Programming / I need to draw something very large in a scrollable field

The only reason I’d suggest rotation over just drawing the circle is that you’ll only ever need the image to rotate/be drawn while the player’s near it, and if they shouldn’t be spending much time near it it probably eats less resources to do it that way.

 
Flag Post

Topic: Game Programming / I need to draw something very large in a scrollable field

Just a thought, and it might not work (still new to AS3), but what if you set it up so you only had an image of a fraction of the circle, just wide enough to go off both sides of the screen, then simply rotate it based on the player’s location? You have the game detect when they’re close enough to the circle to see it, then draw the wall and rotate it so it’s facing the correct way. Then you just move it as the player moves along it, rotating it as you go, until the player moves away.

 
Flag Post

Topic: Game Programming / MovieClip won't stop animating >_<

Then what’s the point of the MovieClip.stop() function? _’ I was under the impression the only way to get any form of animation into AS3 was to use a MovieClip to load an SWF of whatever it is you wanted. If that isn’t the case then what do I need to do to get an animation to use as a sprite/background/etc that I can start/stop whenever I want to?

 
Flag Post

Topic: Game Programming / MovieClip won't stop animating >_<

The SWF I’m putting into the Loader wasn’t made in AS3 though, and I can’t seem to figure out how I would stop it through the Loader. :S

 
Flag Post

Topic: Game Programming / MovieClip won't stop animating >_<

Don’t have Flash, so I can’t. Unless there’s some free SWF editor that I’m not aware of which would let me do that, but I’d still rather find out why it isn’t working here for future reference.

 
Flag Post

Topic: Game Programming / MovieClip won't stop animating >_<

I’m trying to get a quick game together, and am currently toying with sprites and whatnot. I have a MovieClip that I’ve loaded an SWF into, but the MovieClip refuses to stop.

I’m writing my game in Flash Develop in ActionScript 3. The SWF I’m using for my MovieClip was made using SFTToolsm, as I don’t actually have Flash. I’ve tried making the SWF by converting an animated GIF and by converting a series of PNG images. It’s outputting an animated SWF, but as I said I can’t control the thing once it’s in my MovieClip.

Here’s what I’m currently working with in regards to the MovieClip:

var sprite:MovieClip = new MovieClip();
var spriteLoad:Loader = new Loader();
sprite.addChild(spriteLoad);
spriteLoad.load(new URLRequest("../resource/output.swf"));
addChild(sprite);
sprite.stop();

Anybody have any idea why this isn’t working?

 
Flag Post

Topic: General Gaming / Orbital Decay -- now with essential advice in 1st post

Ok, so I did the strategy with selling the fighter bay and maxing main gun damage ASAP. And I beat it. Only died once during the second minefield because one of the carriers was blocking the mines. What’s the point in including fighters and turrets if using them will only result in you losing?

 
Flag Post

Topic: General Gaming / Orbital Decay -- now with essential advice in 1st post

I had 4 bays at 2 fighters each with 2 upgrades to build speed each. Once the enemy fighters started showing up they’d get distracted and everything goes downhill from there. I’ve made it past the mines twice only to die immediately after.

 
Flag Post

Topic: General Gaming / Orbital Decay -- now with essential advice in 1st post

Chapter 6 in hard is beyond unfair. I have no issues killing off the mines that are going to hit me, the issue is with my fighters leading the mines that would have missed into me. Or my favorite part, when my fighters decided it was a good idea to lead an entire wall of the mines right behind an asteroid that was heading straight for me.

And I’ve also found that the asteroids do the same amount of damage no matter what size they are. With enough repair upgrades you can ignore them easily, that’s how I got past the chapter with the Snake.

Also the carriers in the Snake chapter don’t go away when they get to the back of the screen. During one of my attempts I got to the Snake, scrolled back and found that two of the carriers were still behind me. I didn’t live very long.

 
Flag Post

Topic: Game Programming / Bitmap Events Help? [Fixed]

That fixed it. Thanks!

 
Flag Post

Topic: Game Programming / Bitmap Events Help? [Fixed]

The important code I have is:

public class Main extends Sprite
{

[Embed(source = "/img/Title.gif")]
private var TitleIMG:Class;

private var title:Bitmap;
private var info:TextField;

public function Main():void
{
InitMenu();
}

public function InitMenu():void
{
title = new TitleIMG();
title.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addChild(title);

info = new TextField();
addChild(info);
}

private function onMouseOver(evt:MouseEvent):void
{
info.text = "This is a test";
}
}
    
 
Flag Post

Topic: Game Programming / Bitmap Events Help? [Fixed]

I’m trying to create a Bitmap that will trigger an event when the mouse is moved over it that changes the text in a TextField object. I used bitmap.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver) to add the event. I’ve checked and the event is indeed being added, but it refuses to trigger. Can anyone tell me what’s wrong?