Be a Supporter!
Relative and absolute x and y Posted March 17th, 2011 in Game Development

I noticed that for objects within objects, it only gives you the x and y values relative to that object, for instance:

MCA is a child of MCB, MCB's x value is 50 and so is MCA's. But, when you do trace(""+MCB.MCA.x) it returns "0" because that is its relative x value to MCB.

Is there a way to get an absolute x value? IE the value it is on the screen regardless of where it is in an object? Thanks

Response to: [AS3] Moving the stage view in as3? Posted February 6th, 2011 in Game Development

At 2/6/11 01:03 AM, Urbanmaws wrote: yeah it was Vcam and i think there is a Vcam that is compatable with AS3 and like i said thats just an i think

cuz as far as i know everyone still just uses AS2 for flash games n such

Hahahahahahahahahahahaahahahahahaha, no!

As3 is way more powerful, people only use as2 to make quick button click games now!

Thanks Marsune!


Hi! I've been looking for a way to move the view of the screen in my game if you get what I'm saying. I'm making an a top down RPG and was wondering if anyone had a tutorial for something like this for as3. I remember in as2 there was something like an Rcam or something that was really easy to use but I cant find anything like it for as3.

Thanks!

Response to: AS3 hurts my game deving Posted January 20th, 2011 in Game Development

var Container:Array;

Container[i].addChild(block);

Container[i].removeChild(block);

Container[i].splice(i,1)

Or something like that
Response to: C# and arrays help ! Posted May 22nd, 2010 in Programming

Yea i did end up using reverse logic.

I thought it defaulted to nul, but it defaulted to false.

Thanks anyways.

C# and arrays help ! Posted May 22nd, 2010 in Programming

This is how i am structuring my arrays in c#:

const int MAX_SETS = 50;

            bool[] is_clear;
            is_clear = new bool[MAX_SETS];

I want on the creation of the array to set every single value in the array to true, i don't know how to do it.

Short of doing is_clear[1,2,3,4,5,6,7,8,9....] = true i cant think of any other way/

PLEASE HELP

Response to: MC Duplication handling Posted August 30th, 2009 in Game Development

Yeah... Your code almost caused my flash to crash lol.

I'm gonna keep trying to work it out. But if you want to still try think of another way be my guest.

MC Duplication handling Posted August 29th, 2009 in Game Development

I finally got the hand of MC duplication and hit a few snags.

Question 1: How do I define values such as the movieclips x,y coordinates on creation say i want it to be random(500)

Question 2: How do I distinguish between the duplicated movie clips?

I have the code running, it's a headfuck and of course it doesn't work

if(this["mog"+i].hitTest(this["mog"+i])&&!this["mog"+i]==this["mog"+i]){
		if(this["mog"+i]._x>this["mog"+i]._x){
			this["mog"+i]._x+=5
		}
	if(this["mog"+i]._x<this["mog"+i]._x){
			this["mog"+i]._x-=5
		}
	if(this["mog"+i]._y>this["mog"+i]._y){
			this["mog"+i]._y+=5
		}
	if(this["mog"+i]._y<this["mog"+i]._y){
			this["mog"+i]._y-=5
		}
	}

Basically I want them to not touch each other everything else I'm fine with.

Thanks in advance :)

Response to: Need Help! Scrollbar As 2.0 Posted August 28th, 2009 in Game Development

Kirupa always does long unnecessary codes that i can never understand, and probably a lot of other people can't figure out too.

Response to: Tut: Creating Flash With Mspaint Posted August 15th, 2009 in Game Development

At 8/15/09 09:46 AM, Greenfrost6 wrote: Or you could be a normal person and make it using Flash.

Second it.

Response to: IC and physics Posted June 28th, 2009 in Game Development

That would cause all sorts of problems, and it wouldn't really help cause oyu wouldent physically be changing anything.

Response to: IC and physics Posted June 28th, 2009 in Game Development

I know of ways to get a "cheap" physics look. If you have kinematics down then I'll just talk about physics.

If you calculate an objects width and the object touching its width, you could make a sort of code that states basically:

object A(ground object) and object B (Falling object)

given : Object A width 100 Height 50.
Object B width 70 Height 40.
Distance between two objects might be 50-xaxis and (90-yaxis-falling speed)
from this you can designate what will happen when the two objects collide, this system seems sound to me but i have always had one problem with flash. I could never find a way to change the turning point of an object on the fly with actionscript. If i had that i would make the physics today but alas i have no idea. :(
Sorry i kinda went all over the place with the above but you can probably understand what I'm getting at with the above about how you would do it :D. I think...

Response to: IC and physics Posted June 28th, 2009 in Game Development

Well to mix Physics into the concoction would just be a vast knowledge of trigonometry. To input inverse Kinematics enfesis on the K would also require trigonometric knowledge. To put them together you would need to be a pretty advanced programmer to do that sorta stuff. I have tried a number of times but i just cant get my head around it.
If your just learning to program now, i wouldn't recommend this sorta stuff, so i would just give up now before you lose any sleep.

Response to: Computer AI Posted May 29th, 2009 in Game Development

Where are these fighting game tutorials you speak of?

Projectile coding. Posted May 15th, 2009 in Game Development

The only code i can find to make movie clips is the following:

if (Key.isDown(Key.SPACE)) {
		i++;
		bul = _root.player.attachMovie("bullet", "bullet"+i, _root.getNextHighestDepth());
		bul.onLoad = function() {
			this._x = _root._char._x;
			this._ = _root._char._y;
		};
		bul.onEnterFrame = function() {
			this._x += 10;
		};
	}

But this attaches itself to the movieclip at which the code is ran making its movement values the same as the movie clip in question.

Does anyone know any way that you can create a movie clip without attaching it to anything so that i can make proper projectiles.

Response to: Rotation from a specific point. Posted May 5th, 2009 in Game Development

What I meant to say was set the point of rotation using actionscript. Sorry bout that.


I was just wondering how i would make an object rotate on a specific point in terms of a point on a movieclip.

Thanks in advance.

Response to: Test my multiplayer engine Posted April 28th, 2009 in Game Development

Nothings happening for me.

Response to: Stupid AS question sorry Posted April 7th, 2009 in Game Development

At 4/7/09 09:15 AM, atomoxic wrote: You will have to make sure your code is constantly running over and over such as using a onClipEvent (enterFrame) handeler for putting the actions on a MovieClip.

onClipEvent (load) {
kick = false;
speed = 5; // Initial speed. Change to whatever value needed.
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE)) {
kick = true;
}
if (kick == true) {
speed = 10;
}
}

This code can only be applied to a movie clip.

I have this exact same code running but it still only makes speed 10 if space is being held down :S

Response to: Stupid AS question sorry Posted April 7th, 2009 in Game Development

Wait wait wait what? You changed nothing?

Stupid AS question sorry Posted April 7th, 2009 in Game Development

For some reason i have overlooked how to do this:

if(Key.isDown(Key.SPACE)){
		kick = true;
	}
	if(kick==true){
		speed=10;
	}

The problem with the code above is that kick = true only if the space key is being held down, how do i make it so that once space has been pressed kick will always = true?

Response to: Real rotation? Posted April 6th, 2009 in Game Development

Yeah guys thanks for the help i have worked it all out all I have to do is set a boundary in which makes the player which way to spin when and to which spot IE (rotation<180&&rotation>0) makes 0-180.

Thanks for all the help i might actually finish a game for once :D

Response to: Real rotation? Posted April 6th, 2009 in Game Development

Well i got a system working:

if (Key.isDown(Key.UP)) {
		if ((_rotation+180)>180) {
			_rotation -= 10;
		}
		if ((_rotation+180)<180) {
			_rotation += 10;

		}
		speed += .07;
	}
	if (Key.isDown(Key.DOWN)) {
		if ((_rotation+180)>360) {
			_rotation -= 10;
		}
		if ((_rotation+180)<360) {
			_rotation -= 10;
		}
	speed += .07
	}
	if (Key.isDown(Key.LEFT)) {
		if ((_rotation+180)>90) {
			_rotation -= 10;
		}
		if ((_rotation+180)<90) {
			_rotation += 10;
		}
	speed += .07;
	}
	if (Key.isDown(Key.RIGHT)) {
		if ((_rotation+180)>270) {
			_rotation -= 10;
		}
		if ((_rotation+180)<270) {
			_rotation += 10;
		}
	speed += .07;
	}

Your input helped allot in it, my only problem right now is that with this system my character cannot rotate to the bottom right all other directions work fine. (I'm trying to make a soccer game :P)

you can see it here:

LINK

Response to: Real rotation? Posted April 6th, 2009 in Game Development

At 4/6/09 09:13 AM, Stilianos wrote: Is there any way to change it to that _rotation in flashes core somehow?

I have made a new variable called "rot" it is defined by rot = _rotation+180 but this is impossible to work with due to the fact that adding to it will change it core structure ie i can't treat it like rotation because instead of changing the actual player rotation i am changing the definition of "rot" its really frustrating.

I should tell you what im trying to do.
I will illustrate:

[URL=http://img243.imageshack.us/my.php?
image=flashisghey.jpg][IMG]http://img243 .imageshack.us/img243/4074/flashisghey.t h.jpg[/IMG][/URL]

if anyone could post me a code that directly relates to my dilemma i would be really greatfull.

SORRY PAINT SCREWED ME HERES THE REAL PIC

[url=http://img222.imageshack.us/my.php?
image=flashisghey2.jpg][img=http://img22 2.imageshack.us/img222/9926/flashisghey2 .th.jpg][/url]

Response to: Real rotation? Posted April 6th, 2009 in Game Development

Is there any way to change it to that _rotation in flashes core somehow?

I have made a new variable called "rot" it is defined by rot = _rotation+180 but this is impossible to work with due to the fact that adding to it will change it core structure ie i can't treat it like rotation because instead of changing the actual player rotation i am changing the definition of "rot" its really frustrating.

I should tell you what im trying to do.
I will illustrate:

[URL=http://img243.imageshack.us/my.php?
image=flashisghey.jpg][IMG]http://img243 .imageshack.us/img243/4074/flashisghey.t h.jpg[/IMG][/URL]

if anyone could post me a code that directly relates to my dilemma i would be really greatfull.

Response to: Real rotation? Posted April 6th, 2009 in Game Development

Yeah it didn't work the way you were saying Shinki's method on the other hand worked very nicely.

Thanks Shinkster! Now run along and code scgmd4! JKS

Response to: Real rotation? Posted April 6th, 2009 in Game Development

That's what i was thinking of thanks man.

Real rotation? Posted April 6th, 2009 in Game Development

I'm coding some stuff that involves rotation. I was coding some rotation when some basic code want working i did a trace "trace(_rotation)" and found that the rotation was really weird. It goes from 0 to 90 to 180 and immediately after -180 to -90 to -0. Is there any way to change it back to a full 360 degrees? Thanks

Response to: A website, it might need some tests Posted April 5th, 2009 in Game Development

Bro the idea when making a flash site is that you stay in the same shockwave file throughout the entire website. When you click on your animations they should load within that shockwave file look into the loadmovie() command. Also its not very appealing in my oppinion.

Response to: Is my game a little too hard? Posted April 4th, 2009 in Game Development

First of all nes games never ran at that amount of fps. And what the other guy said was true they should be a slightly different colour, all the oldschool games had something to signify that the block was faulty, furthermore nes games never had you flying and sliding at light speed you should consider making it much much more slow pased and just stick with good old fashion enemies instead of trickery.