You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!

Author Search Results: 'Afro-Ninja'

We found 12,283 matches.


<< < > >>

Viewing 91-120 of 12,283 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7208410

91.

None

Topic: AS2 noob question...

Posted: 06/12/09 06:00 PM

Forum: Flash

onMouseDown = function() {
var myBullet:MovieClip = attachMovie("Bullet");
myBullet._x=_xmouse;
myBullet._y=_ymouse;
}

or something along those lines, I didn't test it out.

where did you get this 'add MovieClip{}' syntax from?
and moveTo is for the drawing api, not positioning. Did you browse the reference manual looking for code segments that might randomly apply to what you want to do?


92.

None

Topic: plataformer help with combo AS2

Posted: 06/12/09 03:45 AM

Forum: Flash

At 6/12/09 03:16 AM, damianemtum wrote: hi,

im making a plataformer game i already have movement , stages, health, etc etc

but im having problems with the "combos"

i want that my char when i press (for example "spacebar" ) hit and when i press spacebar again it makes another different hit and so

i know that i have to draw different frames inside the movieclip for each hit

but i dont know how to make it works :S

any help?

well... a basic way is to just check the frame position and make a judgment on if they correctly followed the combo or not

so let's say attack 1 has 50 frames. Near the end, from 40-50, is when the second part of the combo can be activated. when you evaluate the key press for space, check to see what attack animation they are on and what the current frame is. if it's attack one and in between 40-50, then switch to the next animation. otherwise reset the first one or don't do one at all.

there's a ton of ways to approach this because there are a ton of ways to organize and nest your attack animations inside a character sprite. and you can also choose between things like evaluating frame position and setting booleans like 'okToCombo' on the actual frames of the attack animation.


93.

None

Topic: 3d game

Posted: 06/12/09 03:36 AM

Forum: Programming

And start with the absolute basics, jumping into a 2d sidescroller is a bit much. That needs to be broken down into components like character movement, keyboard input, collision testing, etc. But first you need to know the basics of actual programming.


94.

None

Topic: Please I Need Help - Variables

Posted: 06/11/09 12:20 AM

Forum: Flash

At 6/10/09 11:45 PM, D3m0n1c707 wrote: I intended to have a input text with the variable name of "name" to interact with a dynamic text of the same variable name. but when i test play, the dynamic text appears as undefined.

Older versions of flash allow a sloppy and improper way to do this. I'm not sure when they took it out, maybe it's just if you're using AS3. Anyway, this is what you want to do- give your dynamic text box an instance name. Then, in your code, do

textBoxInstanceName.text="whatever";

get rid of whatever you have filled in for the 'variable name' option on the text box, if that's the case.


95.

None

Topic: I am organizing a flash team

Posted: 06/10/09 11:45 PM

Forum: Flash

At 6/10/09 11:42 PM, Delanite wrote: any movie is nowhere without a script, I will not take full credit for a team effort, all i am looking for is someone who I can team up with to make a movie

The problem though is that flash movies usually don't have intricate scripts. Not to say that writing doesn't have its place, but you need to be fairly established/noteworthy and provide proof of skill when it comes to writing. As they say ideas are a dime a dozen. Ideas are what inspire people to create flash in the first place. If someone has the skills to do what you're looking for, why wouldn't they just write and produce their own ideas?


96.

None

Topic: Actionscript in versions of Flash?

Posted: 06/10/09 11:04 PM

Forum: Flash

At 6/10/09 09:48 PM, Sparkky wrote: Well with the new patch, AS4 has some really nice features, and runs smoothly.

it's AS3, and CS4. AS3 will run virtually identical between CS3 and CS4 unless you're making heavy use of the new vector class


97.

None

Topic: Random Enemies Help

Posted: 06/10/09 05:52 PM

Forum: Flash

Use random numbers. Let's say you wanted the enemy's x position to be between 0 and 500. You use the function

Math.random();

which will return a number between 0 and 1. Multiply that number by 500 to get a number between 0 and 500, then assign it to your enemy

var randomX:Number = Math.random()*500;
enemy.x=randomX;

You would need to do it for y as well. if you don't want the enemy to appear off the screen you need to adjust the formula to take the enemy's height and width into account

Alternatively if you wanted the enemy to appear in set positions (IE, top left bottom or right), then store those points in an array

var startPositions:Array = new Array();
startPositions.push(new Point(10,10));
startPositions.push(new Point(400,10));
startPositions.push(new Point(10,400));
startPositions.push(new Point(400,400));

then pick out a random spot in the array to use

var randomStartIndex:uint = Math.floor(Math.random()*startPositions.length);
var randomPoint:Point = startPositions[randomStartIndex];
enemy.x = randomPoint.x;
enemy.y = randomPoint.y;

this code is in AS3, if you're using as2 it will be slightly different (mostly just the use of _x and _y instead of x and y);


98.

None

Topic: Favorite Actionscript Editor?

Posted: 06/09/09 08:49 PM

Forum: Flash

At 6/9/09 07:36 PM, gumOnShoe wrote: Alright, I'm checking it out gotta do the .NET install, however, that's a drawback...

.NET? hm, I didn't need to install anything extra, perhaps it was already on my machine... doesn't seem to be, unless I'm checking the wrong area.


99.

None

Topic: Favorite Actionscript Editor?

Posted: 06/09/09 06:48 PM

Forum: Flash

Try Flash Develop
http://www.flashdevelop.org/wikidocs/ind ex.php?title=Main_Page

not only does it have code completion but it will track variables and functions inside of the classes you create and provide code hints/completion for those as well

pressing ctrl+enter inside of flashdevelop will jump to the flash IDE and execute the currently open .fla document

only downside for is the documentation- when you load the language reference in flashdevelop it loads the online version into a tab in the program. which is fine except that I can only get it to load via internet explorer, and it always pops up script errors while I browse.

other than that, it's a great tool


100.

None

Topic: how to round numbers

Posted: 06/09/09 06:17 PM

Forum: Flash

At 6/9/09 04:16 PM, UnknownFury wrote: Math.round(#);

You'd probably want to use Math.floor(num);

if the loading percent is 99.55, that will be rounded to 100 and will imply that the movie is fully loaded when it is not


101.

None

Topic: Image Html Code.

Posted: 06/09/09 06:14 PM

Forum: Programming

At 6/9/09 05:46 PM, Super-Yombario wrote: 25% of the internet use any IE version, so you know

where did you get that statistic from? According to my google analytics report, 65% of my traffic uses IE

I don't know how to fix the CSS error, so I'll just keep it there. And the invalid HTML is because of the links. Apparently you can't have anything like &, =, or ? in your links. Maybe that's my bad. But just because I don't know how to make my code perfect doesn't mean I don't know what it does. So I daree you to find anything in my source that I can't explain, huh?

& must be written as &amp; because '&' is the character that signifies an escaped html entity.


102.

None

Topic: "_root.onLoad" replacement in AS3?

Posted: 06/09/09 06:04 PM

Forum: Flash

At 6/9/09 05:54 PM, Oldsage10 wrote: Oh, ok... It's just that I wanted to organize it in a function... But I found a work-around, just put it in an ENTER_FRAME, and then within the function, remove the EventListener...

you can do that too, no need for an enter_frame. just put this on the first frame.

function init():void
{
//stuff goes here
}

init();

if you're worried about the first frame being revisited, you can use a boolean to make sure that init can only get called once ever.


103.

None

Topic: "_root.onLoad" replacement in AS3?

Posted: 06/09/09 06:02 PM

Forum: Flash

Look into using a document class. The constructor of the document class will fire exactly once, when the .swf is loaded. You can also fill the document class with functions that apply to the scope of the .swf file as a whole (like pausing a game for example)


104.

None

Topic: PHP globals: the class version

Posted: 06/08/09 04:32 PM

Forum: Programming

At 6/8/09 12:56 PM, Momo-the-Monkey wrote: That does not work. An error, "Call to a member function myFunc() on a non-object" results. I have looked into define() which only uses scalar values, I have tried global variables, which I still have to define in every function I want to use them in, and obviously the code above does not work. I am slowly believing I have no other option but to resort back to function work for the deep stuff. V_V

scoping is a bit different in php
http://us2.php.net/manual/en/language.va riables.scope.php

if you're not passing $newclass to the function then you need to do

function outsideFunc(){
    global $newclass;
    $newclass->myFunc();
}

105.

None

Topic: Porting flash to DS?!

Posted: 06/08/09 03:55 PM

Forum: Flash

It would most likely involve re-coding the entire game to work on the DS while using the flash version as a guide. If you want to call that a port.


106.

None

Topic: Image Html Code.

Posted: 06/08/09 03:53 PM

Forum: Programming

At 6/8/09 03:42 PM, Super-Yombario wrote: I LOVE CSS, I use it all the time. The website I am making would never remotely look nice without CSS. But he asked how to align it to the center WITH THE ALIGN ATTRIBUTE. He never mentioned CSS. I hate how this forum shoves CSS down the throat of every beginner who asks a question about attributes.

so we should continue to explain/teach old and deprecated methods of design, without any mention of the right way to do it?


107.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 03:52 PM

Forum: Flash

At 6/3/09 02:42 PM, GustTheASGuy wrote: First of all I don't use an ENTER_FRAME listener for each object. I store active objects in a list and iterate them from a single enterframe listener. So pausing is as easy as skipping that iteration.

Ah, that's probably a more efficient way to go about doing this. The only problem I see with that is in the event that I would want any object to have multiple ENTER_FRAME events. If the player gets hit by an enemy and starts flashing I'd assign that to a separate handler, though I could still just do it from the main function.

Secondly I'd put the game graphics in a designated sprite object, so when I want to pause all sprites, I only apply the recursive pause function to that sprite.

Yeah, all game graphics are inside of a sprite called GAME_CONTAINER. The problem I ran into with the recursive thing is that it still doesn't mean I want all sprites to be paused or not. For example if the main character has a helmet sprite that changes as the player equips different things- when the game is unpaused that sprite will be caught in the loop and will start cycling through all the helmets.

Sorry for not being descriptive enough, the engine I'm making is still pretty early and I'm really not sure what all it will need to account for yet, just trying to keep it flexible. I'll play around with these ideas as the engine develops and see what works best. Thanks again for the input.


108.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 02:25 PM

Forum: Flash

oh, and I know I said "Then it needs to stop any movieclips marked as 'pausable' inside of each game object" but that's not what I'm doing right now, I'm just manually recognizing any possible animations that could be playing when the game is paused.


109.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 02:23 PM

Forum: Flash

At 6/3/09 02:06 PM, GustTheASGuy wrote: Implementing an interface is less painful than having to name all the animation elements. But it looks like you can safely pause all animation elements and the like without having to name them, right?

Anyway just do it how you like (or describe exactly what you want to pause for me).

yeah, I'd still have to name them all

I guess my question is, how do I implement the Pausable interface for movieclips like my walk cycle that don't have an explicit class definition?

The pause function's first task is to make sure that all active game objects (player, enemies, particles, etc) inside the game container remove their ENTER_FRAME event listeners. Then it needs to stop any movieclips marked as 'pausable' inside of each game object. This is the current 'pauseMe' function I use for the main player:

public function pauseMe():void 
		{
			removeEventListener(Event.ENTER_FRAME, this[mainEventHandler]);
			if(walk!=null)walk.stop();
			if(attack!=null)attack.stop();
		}

also I didn't realize you could iterate children by just

for each (x in mc.children)

Thanks for that. And thanks for your comments so far, it helps to see how someone else would go about doing this.


110.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 01:59 PM

Forum: Flash

At 6/3/09 01:44 PM, GustTheASGuy wrote: public interface Pausable extends flash.display.MovieClip { }

public function pauseAll (mc : flash.display.DisplayObject)
{
if (mc is Pausable) mc.stop ();
var mc_;
if (mc_ = mc as flash.display.Sprite)
for each (x in mc.children) pauseAll (x);
}

Your way is really ugly is all.

But don't you only need to pause entire known sub-branches of the display list (as in the container of the game view and stuff)? Cause you don't need to check which elements to pause if you apply the function to those branches.

I'll have to pause things like the walk animation and attack animations that aren't associated with any class at all, they're just vanilla movieclips placed at certain spots in the character sprite. I also couldn't assign boolean variables (from the parent class) to them for being 'pausable' because they don't necessarily exist on the first frame of the character.

I'm still thinking the event model would be most efficient-

function pauseGame():void
{
var pauseEvent:Event = new Event("game_pause");
dispatchEvent(pauseEvent);
}

then in any class I make

addEventListener("game_pause", pauseMe);

function pauseMe(e:Event):void
{
if(mc_attack!=null)mc_attack.stop();
if(mc_walk!=null)mc_walk.stop();
}

That might not be the right syntax, I haven't worked much with custom events yet. But I think that would be the general idea.


111.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 01:25 PM

Forum: Flash

At 6/3/09 04:51 AM, GustTheASGuy wrote: Use an empty interface to indicate what should be paused. Or instead, define a method for pausing the right stuff in each element.

Yeah, that's what I'm going with now. Classes based on game objects all have a pauseMe/unpauseMe function. When the game pauses the main game container loops through its children, if the curChild is a MovieClip it will attempt to call its pauseMe function with a try/catch. However I think I'm going to create custom 'game_paused' and 'game_unpaused' events that are dispatched at the right time, so only the classes that can pause will listen to them. Not sure what you mean by an 'empty interface' though, I never use interfaces. Are you saying that the interface would contain these pause methods, so any class implementing it will be forced to use them?

Or really easily, you can set stage.frameRate to 0. If that makes the screen look bad because some elements shouldn't be paused, blur everything and put a minimal pause screen on top. That looks cool and not too cheap, usually.

I tried the frameRate thing but that wont work the way I want, for example when accessing the map I want the game to pause and fade the map in over top. If the frameRate is 0 the fade will never occur. If there still end up being animated elements not covered by my pause event then yeah, I can draw a copy of the screen over top of everything as a bitmap.


112.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/03/09 03:21 AM

Forum: Flash

I was checking the superclass because that's all I needed to know, if the base class was movieclip or not. It didn't matter what the (potential) inherited class was

That being said, I fixed the problem (via help from kirupa) by simply doing

if(curObject is MovieClip)

THAT being said, I realized this method wont work because I don't always want to pause/play every movieclip contained within any other given movieclip


113.

None

Topic: Unwanted MC to Sprite at runtime

Posted: 06/02/09 07:51 PM

Forum: Flash

So I'm working on a pause function for my game.

Instead of manually writing code to pause all possible animations that a movieclip has, I wrote a function that runs through its children recursively until it reaches the end. For each child it checks to see if it's a movieclip, if so it will run a stop() on it. This works fine, except that I noticed it wasn't pausing my walk cycle. Upon some investigation I found that while I created the walk cycle as a movieclip, it is recognized by flash as a sprite when the game is actually loaded. This does not make sense because the walk cycle clearly has more than one frame.

Adding any kind of code to the MovieClip will stop flash from seeing it as a sprite, so to fix this I can just go into the animation and add '//' to any of the frames. An easy fix, but annoying. Also feels like a hack. Maybe I'm missing something fundamental here, but I was wondering if anyone else had encountered this or had some insight.

Here's my pause code btw:

public static function togglePauseChildren(curObject:*):void
		{
			if(getQualifiedSuperclassName(curObject)=="flash.display::MovieClip")
			{
				if(curObject.numChildren>0)
				{
					for(var i:uint=0; i<curObject.numChildren; i++)
					{
						var curChild:* = curObject.getChildAt(i);
						if(getQualifiedSuperclassName(curChild)=="flash.display::MovieClip")
						{
							if(gamePaused)curChild.stop();
							else curChild.play();
							togglePauseChildren(curChild);
						}
					}
				}
			}

114.

None

Topic: How long does it take to learn?

Posted: 06/01/09 04:05 PM

Forum: Programming

What's your definition of a 'program'


115.

None

Topic: Wide Layout Update 2

Posted: 06/01/09 02:17 AM

Forum: NG News

At 5/31/09 09:56 PM, Quadrophenic wrote: It's great, but you guys should add a mute button, for games at least.

That's not possible without unloading the whole .swf
Mute functionality is something individual developers need to address


116.

None

Topic: Wide Layout

Posted: 05/27/09 02:09 AM

Forum: NG News

B-B-B-BUT MY 46X46 ICON THAT TOOK ME TWO SECONDS TO SCREENSHOT OUT OF MY FLASH AND RESIZE IS G-G-G-GONE!

I take serious pride in creating my 46x46 icon. I know you still need them for collection pages, front-page featuring, and mouse-hovers in the portal list. But I will not stand for them being removed from the view page.

It's been a fantastic seven years NG but you really pulled a fast one on me here; I know when to take a hint. I suggest you delete my posts, reviews, flash submissions, and account itself. I'll have no traces of my name on this trash heap of html code you call a website.

-Shawn Patrick Afro Ninja Tanner


117.

None

Topic: Actionscript 2.0 help

Posted: 05/26/09 05:57 PM

Forum: Flash

The issue is that you don't understand the fundamentals of programming itself, so naturally you wont understand complex pieces of code built from them

You need to start at the extreme basics. this will give you an overview of the language itself, then start in with data types and variables. Yes it will use some terminology you haven't seen before, such as 'object oriented programming.' Feel free to look these up for a better understanding or just read through the introduction at face value. This guides is for AS2, you can also try starting with AS3 like glaiel suggested.

http://www.adobe.com/devnet/flash/articl es/actionscript_guide.html

When you run into trouble, come back with specific and detailed questions. Not just 'I need codes to do this'


118.

None

Topic: PHP regex questions

Posted: 05/26/09 12:50 AM

Forum: Programming

use the e modifier at the end of your regex (/ies)

http://php.oregonstate.edu/manual/en/ref erence.pcre.pattern.modifiers.php

then pass the $1 to a function for processing in your replace


119.

None

Topic: Power of Three, Plushies

Posted: 05/22/09 07:08 PM

Forum: NG News

For the love of god someone let luis on their team already, the kid's got potential


120.

None

Topic: SF Collab, Power of Three Teams

Posted: 05/22/09 04:42 PM

Forum: NG News

At 5/22/09 04:32 PM, flashwarrior wrote: Can us and our teams still make a game on our own based on three if we feel like it?

yes. you can.


All times are Eastern Standard Time (GMT -5) | Current Time: 03:33 PM

<< < > >>

Viewing 91-120 of 12,283 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7208410