Be a Supporter!

Hey,
In my game, the user uses the mouse to aim their gun and when they click it spawns a movie clip (from the library) onto the stage <<this all works

My problem is - my enemies also get spawned automatically and will have diff. instance names.
Eg, i can't do the basic if(this.HitTest(this(_root.bullet)); because the bullet would have a name like _root.bullet2918 and the enemy would have an instance name like _root.enemy4

Is there any workaround for this? How do other games get around this?
thanks (:

Response to: Newgrounds Achievement Api Posted April 15th, 2009 in Game Development

but im confused - is it only for bg devs or is there an api i can download somewhere?

Response to: Newgrounds Achievement Api Posted April 15th, 2009 in Game Development

At 3/16/09 09:29 PM, Steven-Polley wrote: So... is this where that idea originated from?

yeah so wtf? I come back to ng after a few months break from it and what do i see on my profile.... ACHIEVEMENTS!!!

or "medals" to be precise - so what the hell is that all about? I though this was a shitty idea..?

im so confused right now

Flash website scaling Posted December 19th, 2008 in Game Development

Hey,
Im making a Flash website and i've noticed that when you embed the swf to 100% (so that it fills the whole page) it seems to scale the content

anyone know how to stop this from happening?

heres the page
CLICKY CLICKY
load it up then resize your browser window

thanks!

flash player version [AS2.0] Posted December 9th, 2008 in Game Development

Hey,
Is there a way to get what version of the flash player a user is using through actionscript?

I have been getting reports of my game not working on certain versions of the player but there is no way to ask the user to update or anything like that without asking EVERYONE who plays the game to update. (see my point?)

Or even a way to force the 'Adobe auto-updater thing'?

Anyway, thanks!

Response to: What's wrong with this script? Posted September 28th, 2008 in Game Development

only use Key.<something> if you want to use the predefined keys like Key.UP or Key.SPACE etc

Response to: Wierd Vcam Frame Stuff Posted September 25th, 2008 in Game Development

anyone?

Wierd Vcam Frame Stuff Posted September 24th, 2008 in Game Development

Hey,
I'm using a basic vcam with the following code on the first frame of the vcam mc:

function camControl():Void {
	parentColor.setTransform(camColor.getTransform());
	var scaleX:Number = sX/this._width;
	var scaleY:Number = sY/this._height;
	_parent._x = cX-(this._x*scaleX);
	_parent._y = cY-(this._y*scaleY);
	_parent._xscale = 100*scaleX;
	_parent._yscale = 100*scaleY;
}
function resetStage():Void {
	var resetTrans:Object = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
	parentColor.setTransform(resetTrans);
	_parent._xscale = 100;
	_parent._yscale = 100;
	_parent._x = 0;
	_parent._y = 0;
}
// make frame invisible
this._visible = false;
// Capture stage parameters
var oldMode:String = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX:Number = Stage.width/2;
var cY:Number = Stage.height/2;
var sX:Number = Stage.width;
var sY:Number = Stage.height;
Stage.scaleMode = oldMode;
// create color instances for color 
// transforms (if any).
var camColor:Color = new Color(this);
var parentColor:Color = new Color(_parent);
// Make the stage move so that the 
// v-cam is centered on the
// viewport every frame
this.onEnterFrame = camControl;
// Make an explicit call to the camControl
// function to make sure it also runs on the
// first frame.
camControl();
// If the v-cam is ever removed (unloaded)
// the stage, return the stage to the default
// settings.
this.onUnload = resetStage;

This all works perfectly until I try to move onto a new frame (eg, the next level of the game).
I use the basic

_root.gotoAndStop("lvl2");

to get to the next frame, and that works but the vcam seems to get the contents of the 2 frames and merge them togeather. (it shows frame 2 OVER the top of frame 1 and I can see the other frame's MCs)

Anybody got a fix for this?
Thanks in advance

(PS. pic of my timeline below if that helps)

Wierd Vcam Frame Stuff

AIR app to import swf? Posted August 31st, 2008 in Game Development

Hey,
I'm trying to make an 'Adobe AIR' app but I really hate AS3 (dont bother convincing, i have my reasons) so does anyone know how (in as3) I would import a swf that is using as2 code?

So it would be an AIR app with all the window events and stuff setup in as3 but in the center there is a loaded in swf that has the real 'interactive' stuff, and is written in AS2.

thanks if you can help!
(PS. if you still dont get me I just want to know how to import swfs' programmaticly with as3)

Response to: I made a quickie! Posted August 31st, 2008 in Game Development

that would be a cool preloader!

Response to: No Flash On Iphone!?!? Posted August 4th, 2008 in Game Development

allot of Nokia phones come with flash lite installed - but that can't do much stuff

Response to: Snake Style Movement? Posted August 4th, 2008 in Game Development

okeedokee then.........

WAAAA?

Snake Style Movement? Posted August 3rd, 2008 in Game Development

Hey,
Does anyone know what is the simplest way of having the same movement style as the classic 'Snake' game?
Im not making a snake game, I'm just trying to figure out how you do the one-after-the-other movement;

here is an example of the kind of thing im trying to achieve (youtube)
(im not trying to do the other formations shown in the vid, just the first one)

So yeah, anyone got any idea?

thanks allot.
(PS. my game has 4 MCs in a row just like in the vid)

Response to: No Flash On Iphone!?!? Posted August 2nd, 2008 in Game Development

At 8/2/08 09:21 AM, Xeptic wrote: Adobe is working on a Flash version for the iPhone to be released to the App Store, supposedly this year.

awesome!

And im ranting 'cos wouldn't it be sweet to play your favorite NG games on-the-go?

(PS. I wonder how they will do keypresses - or just not at all?)

Response to: when button ISNT down Posted August 2nd, 2008 in Game Development

onClipEvent(enterFrame) {
     myScore++;
}

Put that into an MC and it will increase the value of

myScore

by 1 every frame.
Hope that helps.

Response to: flash box 360? Posted August 2nd, 2008 in Game Development

so im guessing they just reprogram it with XNA or something and export the flash graphics.....

Response to: Iphone Sdk Development Software Posted August 2nd, 2008 in Programming

At 8/2/08 04:06 PM, DanielZ wrote: if you could do the actual programming in a text editor, you wouldn't get far without the Mac-only iPhone interface builder.

And Apple's super secret compiler recipe!

Response to: Looking for a really good animator Posted August 2nd, 2008 in Game Development

do we get paid?

No Flash On Iphone!?!? Posted August 2nd, 2008 in Game Development

I CAN'T BELIEVE IT!!
Apple and Adobe have announced that current versions of the Flash player run too slowly on the iPhone, while lite versions are too limited!

Well, thats sad - would have liked to be able to goto newgrounds portal on my imaginary iPhone.....

(PS. I GET AN iPHONE ON TUESDAY WOOOOOOOO!)

Response to: when button ISNT down Posted August 2nd, 2008 in Game Development

Or you could have something like

//made this up on the spot, may not work :P
if (Key.isDown(Key.RIGHT)) {
     keyDown = true;
} else {
     keyDown = false;
}

if (keyDown==false) {
     //the code for if the button is not being pressed goes here
}

hope that helps

flash box 360? Posted August 2nd, 2008 in Game Development

Hey,
Just wondering - does the 360 support flash? Or do Tom & co use some other programming language for rendering Alien Hominid and Castle Crashers onto the 360?

thanks.

Response to: Iphone Sdk Development Software Posted August 2nd, 2008 in Programming

iPhone SDK is a plugin for Xcode 3.1, Xcode is a Mac only app!

Sure you can make javascript/html apps for the iPhone but they only look nice if you make it in Dashcode (also mac only, comes with Xcode)

So, um, buy a mac!
But anyway, if you do have an iPhone and you want to play around with the SDK I really recommend you do, its loads of fun even if you dont plan on distributing your apps!

(PS. I get an iPhone on Tuesday WOOOHOOOO!!)

Response to: I can make your ideas a reality! Posted August 2nd, 2008 in Game Development

WOW
Your art style is amazing! I really really like 'Max' or whatever it's called!

I'm kinda stumped for ideas since im working on some other projects at the moment but if you ever want to make a game on the side of your 'hero' project that would be awesome - Im pretty good at Actionscript 2 (dont look at my profile, i have improved loads since then :P)

Sent a PM to you about some other stuff

Hope to see more of your work :)

Response to: unlockable levels! Posted August 2nd, 2008 in Game Development

forgot about that :P

I dont think MrRandomist is going to use it anyway tho :C

Response to: Level Creating (duplicate mc) Posted July 26th, 2008 in Game Development

BUMP
anyone%Pr

Response to: hitTest problem.. Posted July 25th, 2008 in Game Development

um...
That doesn't sound good! What version of Flash are you using? Does it support Actionscript 2.0?

other than that I can't help, sorry.


Hey,
Im making a level editor type thing and Im trying to make it so players can click a button to spawn a kind of block and then the block mc will be copied (from ofscreen) into the center of the screen.

anyhoo, this is what I have so far:

onClipEvent (load) {
	num_block = 1;
}

onClipEvent (enterFrame) {
	if (createMC == "block") {
		duplicateMovieClip(_root.orig_block, "block_"+num_block, 1);

		newMCname = "block_"+num_block;
		_root[newMCname]._x += 50;
		num_block++;

		createMC = null;
	}
}

I think im going wrong with the _root[newMCname]._x += 50; bit

Response to: hitTest problem.. Posted July 25th, 2008 in Game Development

From what you have said im guessing that you want it to move to the next frame of the main timeline?

Anyway, to do that you need to have

_root.gotoAndPlay();

note the '_root.' that tells flash to go to the very top level of your flash (and in this case the main timeline)

hope that helps

Response to: Major Rpg Project Posted July 25th, 2008 in Game Development

hey,
I really like your art style! (the tree and person is awesome but the menu is bad)

Anyhoo,
Im a pretty good AS 2.0 guy and I enjoy working on games just as a hobby ($ is a plus tho :P)

So if you want me to help chuck me an email at captainhams (at) gmail (dot com)

Response to: unlockable levels! Posted July 25th, 2008 in Game Development

integrate something like this into your level buttons (assuming that those are buttons on the level select)

//this is an example for the level 2 button
on(release) {
	if(_root.levelsUnlocked<=2) {
		//player seems to be up to level 1
		//some code here
	} else {
		//player can play this level
		//code here
	}
}

but put this in the main frame or whatever (but only declare it once)

//only let the player play lvl 1
_root.levelsUnlocked = 1;

hope that helps