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 61-90 of 12,283 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7208410

61.

None

Topic: [php] Sorting Arrays

Posted: 07/31/09 08:34 PM

Forum: Programming

At 7/31/09 08:28 PM, Fallin-Again wrote: Is there a way to sort the contents of an array numericly?

http://us3.php.net/manual/en/function.so rt.php
with the SORT_NUMERIC flag

please tell me you didn't even try googling 'php array sort' :*(


62.

None

Topic: how do you make game smoother?(as3)

Posted: 07/31/09 08:20 PM

Forum: Flash

At 7/31/09 08:04 PM, Jereminion wrote: the smoothness and speed is ok but if you move a bit it will lag occationally. can someone tell different ways to make a flash smoother? i put all the static mcs as "cache as bitmap" and the game is at 30 FPS. the quality is set for medium for default too. there is still lag with this.

I didn't notice any major problems. but one thing to watch out for is over-use of filters. It looks like you're using blur filters on the wings, the clouds, and shadows of the characters on the ground.


63.

None

Topic: what is wrong

Posted: 07/31/09 05:28 PM

Forum: Flash

you didn't really tell us what errors it was giving you, but there's no such thing as 'Key.65.' Just use 65 by itself


64.

None

Topic: Little problem

Posted: 07/29/09 09:16 PM

Forum: Flash

At 7/29/09 07:28 PM, DFlame6 wrote: What would you suggest using to make the screen follow the character?

create the entire game (or at least the parts that move together) inside of a container, then program the container to move correctly around the screen based on the character's movements.


65.

None

Topic: Little problem

Posted: 07/29/09 07:07 PM

Forum: Flash

make the health bar a movieclip and place it in the vcam. there's no reason a health bar wont work as a movieclip, it just depends how you set it up and reference it

also, I do suggest not relying on the vcam in the future. as stated it was built as an animation tool. since you aren't familiar with the inner workings it's likely to cause issues for you down the road as well.


66.

None

Topic: flash platformer collision issue?

Posted: 07/29/09 05:45 PM

Forum: Flash

At 7/29/09 05:15 PM, johnfn wrote:
At 7/29/09 05:01 PM, Genocide wrote: I know this is going to sound awful, but your jokes really made that more confusing then i have a feeling it needs to be.
sorry :< too much coffee

At 7/29/09 05:03 PM, Afro-Ninja wrote:
hitTestPoint didn't exist until AS3, so you have to use hitTest with a different set of arguments
Same arguments, different function call though...I've been using AS3 for way too long, sorry all.

this code also seems to assume that walls exist as separate movieclip? otherwise the clip would stop when touching anything, meaning it couldn't move along the ground
What?

well, you're hitTesting against a clip called 'wal' which I assume would include any walls. If 'wal' represented the whole stage then the collisions wouldn't work right, because the code essentially says 'stop moving when you touch this clip.' So when the clip touched the ground, it could no longer move left or right either.

This could work but it's much easier to have one single 'bounds' movieclip and do all of your hitTest checks against that, instead of separating everything out into walls, floors, celings, etc. Because then you run into gray areas where walls meet floors and/or ceilings and you may get some unwanted results


67.

None

Topic: flash platformer collision issue?

Posted: 07/29/09 05:03 PM

Forum: Flash

At 7/29/09 04:53 PM, johnfn wrote: Here's the dealio. You have a hitTest, yah, but when he hit tests the wall, you only move his y coordinate. So what happens if he is only moving along the x axis? He goes straight through the wall, since you haven't stopped him. Eep.

Here's some pseudo code for what you want to do:

var movement_x = how far he is going to move along x
var movement_y = same thing

if (wal.hitTestPoint (guy.x + movement_x, guy.y+movement_y, true)){
//oh dear! he is going to hit the wall if i allow him to move more! stop him quick!
movement_x=0
movement_y=0
}

//thank god, he is safe from the treacherous wall
guy.x += movement_x;
guy.y+= movement_y;

Astute readers might notice that this code isn't perfect either. There is a small problem, but I'll leave you to think about it!

hitTestPoint didn't exist until AS3, so you have to use hitTest with a different set of arguments

this code also seems to assume that walls exist as separate movieclip? otherwise the clip would stop when touching anything, meaning it couldn't move along the ground


68.

None

Topic: flash platformer collision issue?

Posted: 07/29/09 04:57 PM

Forum: Flash

well, you're only doing collision for the bottom, and you're checking the entire object at once which isn't correct. what if that circle jumped into the ceiling? it would touch the top, then stop moving altogether.

try using hitTest in point mode. doing so involves specifying a clip to check against (the ground) and a specific point. for example:

if(!_root.ground.hitTest(_x, _y+_height/2)){_y+=4}

this assumes the registration point for your clip is in the center, and that the ball clip and the ground clip are both on the root. the single point that this function checks is the bottom middle of the ball. Once the bottom middle of the ball is no longer touching, the ball will fall. To correct this, add in extra points to check with additional hitTests. Namely, the left and right bottom sides.

if you're doing a lot of hitTests it's a good idea to store repeated values into a local variable, such as _height/2. There is no need to constantly access the height property and halve it in the course of this frame event, it's never going to change.

once you get this working follow the same pattern for checking the left, right, and top sides

and when you move on from this, try doing your collisions with bitmaps and pixel checking, it will be much faster


69.

None

Topic: trying to create a swf player

Posted: 07/29/09 02:11 AM

Forum: Programming

look into using swfobject, it should handle all your needs


70.

None

Topic: Need help with platformer(AS2)

Posted: 07/29/09 01:06 AM

Forum: Flash

try starting with tutorials on the concepts of programming itself, not 'making a platform game with actionscript'


71.

None

Topic: Programmer wanted

Posted: 07/29/09 01:05 AM

Forum: Flash

At 7/28/09 10:42 PM, Anamethatworks wrote: try using a shape tween instead. that should keep your fill neatly inside the lines. (or totally pull it inside out.. which case add some shapehints)

you need to totally separate that part of the chest and put it on its own layer, either as a raw vector to be shape tweened, or a symbol to be motion tweened. You can't tween just the line, and you can't motion tween with other stuff on the layer

honestly I think you had the right idea before with the frame by frame approach. the reason it looks like a bullfrog is because you only animated the throat/upper chest. If you watch someone breathe, a dog even, notice that the entire upper body moves. fixing this to be correct isn't an easy thing to do, I'm just trying to help you understand why it doesn't look right.


72.

None

Topic: Ponder An As:2 Conundrum /w Me...

Posted: 07/28/09 09:39 PM

Forum: Flash

At 7/28/09 09:20 PM, gumOnShoe wrote: I suppose I could try out Flex, as a free editor like that wouldn't be hard to acquire. Does anyone have experience with it or know how powerful it is??? I would assume its not as fully featured as Flash, especially when it comes to creating images, etc....

no experience with flex myself, I believe external assets are compiled into an .swc file and handled by flex from there

Would it place it on the stage though? I thought you had to use either createEmptyMovieClip() or the similar "attach" method to put a movie clip on the correct level, inside of a specific clip etc.

ack, sorry, I'm getting my as2 and as3 mixed up. in as3 the syntax would be:

var myMovieCan:MovieCan = new MovieCan();
addChild(myMovieCan);

in as2 for this method you would need to have a custom class for each type of object on the screen, which inherits from MovieCan, which inherits from movieclip. set up the linkage for each clip in the library, then bring them in with attachMovie. I think... : /

there still might be some sort of prototype route you can take but I never got that far into AS2

as a side note- there is a really cheap way to clear the screen in as2-

for(var mc:String in _root)
{
	_root[mc].onEnterFrame=null;
	_root[mc].removeMovieClip();
}

that should be used in accordance with instanceof to make sure you're dealing with movieclips, as I believe that loop will inspect even variables. but again, it's been a while.


73.

None

Topic: Ponder An As:2 Conundrum /w Me...

Posted: 07/28/09 08:55 PM

Forum: Flash

First and foremost, you should reeaalllly move on to AS3 when you first get the chance. The syntax and feature set would be much more appropriate for the stuff you're trying to do.

as for extending the movieclip class- why make use of createEmptyMovieClip when you can create an instance of your new class directly?

var myMovieCan:MovieCan = new MovieCan();

this is effectively the same as creating an empty movieclip, but now it has the functionality of whatever MovieCan implemented. But you're right, you couldn't apply this to the root. I'm getting a bit rusty on my AS2 implementations so I'll stop here before I butcher it.

FOR AS3:
Key listeners are handled by the stage only, not individual objects. Also, both textfields and movieclip are subclasses of displayobject. So if you want to clear the screen, or even just an individual object, I'd suggest simply creating a utility function to do so

static function clearDisplayObject(obj:DisplayObject):void
{
while(obj.numChildren > 0)
{
var curChild:DisplayObject = obj.getChildAt(0);
curChild.dispose();
obj.removeChild(curChild); 
}
}

This would remove all children from the given display object's list. Once removed from a display list, the object will be cleaned up by the garbage collector UNLESS there are still references to it. The most common source of remaining references are those created by event listeners. This is where the dispose method comes in. Dispose() is something you would need to define yourself, a custom method that would remove an object's event listeners. The object itself needs to handle this because we do not yet have a way of iterating an object's listeners like we do with its children.

That's all well and good, but what if the object in question has no event listeners? What if the object is a basic sprite or movieclip that hasn't been subclassed into anything? Here you could consider implementing a 'disposable' interface, where any class that needs this functionality is required to implement a dispose method. (thanks to mike for the tip on this!)

public interface Disposable
{
public function dispose():void;
}

then we can modify our previous code to act accordingly

if(curChild is Disposable)curChild.dispose();
obj.removeChild(curChild);

What about basic sprites and movieclips that have no subclass but do have event listeners? I make it personal practice that any object needing event listeners also needs its own subclass, so that's never an issue for me.

Since the root is of type MovieClip, you can simply do

clearDisplayObject(root);

that only works from the main timeline though, anywhere else it would need to be part of a display object that has already been added to a display list, so that it has access to the root property.

Lastly, you may be interested to know that AS3 supports 'document classes.' Basically, a class that represents the root itself. For example I use a class called Game, which extends MovieClip (it has no other choice). The constructor of this class serves as the program's main point of entry.

I am still learning a lot about AS3 as I go, so I would love to hear any comments, critiques, or corrections that anyone has to offer.

There are a lot of ways to approach this problem so I hope this provided at least a little insight.


74.

None

Topic: I'm a java |\|00|3

Posted: 07/23/09 12:38 AM

Forum: Programming

At 7/23/09 12:29 AM, eshnah3 wrote: I'm making it straight from the console

hm, if you're having issues with this then you might want to take a step back and read through some tutorials first. the first google result for 'java read from the console' is

http://www.java-tips.org/java-se-tips/ja va.util/how-to-read-input-from-console.h tml

which should be what you're looking for.


75.

None

Topic: I'm a java |\|00|3

Posted: 07/22/09 11:25 PM

Forum: Programming

At 7/22/09 10:36 PM, eshnah3 wrote: I was making a java program and i came across an obstacle

I don't remember how to allow a user to alter the value of a variable
can someone help me out here?

well, that depends what kind of program you're making
you could get it straight from the console, a prompt box, a form control, a text file, etc...


76.

None

Topic: PHP - number of rows per type?

Posted: 07/22/09 07:00 PM

Forum: Programming

At 7/22/09 06:37 PM, citricsquid wrote: haha, afro; exactly what I needed. DISTINCT is the argument I was looking for, works perfectly. Much appreciated :)

no problem. like I said though there's probably a more efficient/proper way to do it with a join, just keep that in mind :)


77.

None

Topic: PHP - number of rows per type?

Posted: 07/22/09 06:21 PM

Forum: Programming

I'm not really an expert on compound queries like that, but this is a quick and dirty way to do it with two separate queries:

$result = mysql_query("SELECT DISTINCT type FROM stuff");
foreach($result as $row)
{
$result2 = mysql_query("SELECT name FROM stuff WHERE type = {$row['type']}");
echo '<br /><br />names associated with type #', $row['type'] ,': ';
foreach($result2 as $row2)
{
echo $row2['name'],' ';
}
}

my php and sql is a little rusty at the moment so take this with a grain of salt.


78.

None

Topic: Javascript; delay ajax call for PHP

Posted: 07/21/09 02:45 PM

Forum: Programming

At 7/21/09 06:11 AM, citricsquid wrote:
At 7/21/09 01:18 AM, Afro-Ninja wrote: using timeouts or sleeps in a case like this is a bad idea because you never know exactly how long the script will take to execute
how should it be done then?

oh, well that was just in response to the original method you were trying to implement. waiting on the status return of the ajax call should be sufficient unless I've misunderstood something about what you're doing here.


79.

None

Topic: Javascript; delay ajax call for PHP

Posted: 07/21/09 01:18 AM

Forum: Programming

using timeouts or sleeps in a case like this is a bad idea because you never know exactly how long the script will take to execute


80.

None

Topic: Program suggestions?

Posted: 07/16/09 01:16 PM

Forum: Audio

At 7/16/09 03:53 AM, joshhunsaker wrote: Best way would be to actually get a keyboard and start plinking around to get a feel for what you can do with a controller. Hook it up to a Synth1 (freeware) module in FL Studio and start tweaking and teach yourself basic synthesis while you're at it.

FL Studio is probably one of the easiest ways to get into general multitracking. The workflow is a little unconventional (pattern based) but it's still very intuitive and makes for quick part (pattern) juggling if you can wrap your mind around the wealth of patterns you'll be inclined to create once you get the hang of it.

Reaper is a cheap alternative and offers an extremely quick and easy to navigate interface which is enormously powerful and offers better multi-core support than any other DAW on the market right now. Probably will stay that way as well. Extremely tightly/efficiently coded piece of software.

What exactly do you mean by patterns?
In my mind I could create a basic drum pattern that repeats throughout most of the track, then store it for future use. Then in the 'timeline' for the main track I could lay down that pattern 20 times, stick a fill in the middle, then lay it down 20 more times. Is this sort of how the workflow would go?


81.

None

Topic: Program suggestions?

Posted: 07/16/09 01:53 AM

Forum: Audio

also I'll assume I'm going to want something where I can easily swap in soundfonts or vsts(?) so my stuff doesn't sound incredibly generic


82.

None

Topic: Program suggestions?

Posted: 07/16/09 01:52 AM

Forum: Audio

I've been looking to get into some real basic music production and thought I'd ask around for suggestions on a good program to use.

My pal Josh/kelwynshade uses FL studio and it seems to be a popular choice around here, but I feel it might be a bit much for me, I don't know.

Right now I only have a very basic knowledge of music theory, I'm familiar with notes, scales, and the idea of the circle of fifths. I don't really know the circle of fifths that well, I just know it's a shortcut to writing out the scales for any note. I can't play any instrument but I'm semi-familiar with drums.

I really just want to create some original, basic songs. Start with a drum track, mix it up with some nice fills/transitions, and place some piano notes in over top. While I have no doubt I can accomplish this with FL, is the scope of what I want to do way too simple? I also don't want to waste time learning a much more limited program when I'll want to step up to something more advanced later.


83.

None

Topic: Sony vegas messed up colors

Posted: 07/10/09 07:28 PM

Forum: Programming

this forum is for programming languages, not really 'using programs'

chances are you wont find much help here, I'd try googling your problem and/or looking for forums that deal specifically with video editing software.


84.

None

Topic: How?

Posted: 07/07/09 12:44 AM

Forum: Programming

Flash forum


85.

None

Topic: bit of actionscript help

Posted: 06/17/09 02:58 AM

Forum: Flash

At 6/17/09 12:57 AM, vgthing wrote: if (this.hitTest( _root["fan"+numfan])){
_root.score+=100;
_root["fan"+numfan].gotoAndPlay( 10 );
this.removeMovieClip();
}

Again, thanks in advance!

are you running that through a loop? you need to loop through and check each fan on the screen


86.

None

Topic: I want to learn AS

Posted: 06/17/09 12:55 AM

Forum: Programming

At 6/17/09 12:36 AM, rascencion wrote: ahhhhhhhh fuck, I am a complete moron. Is there anyway a topic can get moved? Or just lock this one? I'll make one there as soon as a mod makes their move on this one.

re-post in the flash forum


87.

None

Topic: bit of actionscript help

Posted: 06/17/09 12:18 AM

Forum: Flash

according to your loop, the stars occupy depths 0-99

when you create bullets for the player, they start at depth "shotCounter," which I assume starts at 0? if this is the case then your shot counter needs to start at 100

no two movieclips can share the same depth, so each time you fire a shot it's going to replace one of the stars you've created


88.

None

Topic: "Zoom on" with AS

Posted: 06/15/09 09:24 PM

Forum: Flash

At 6/15/09 09:11 PM, Toady1104 wrote: Im using AS 3.0 and scaleX ++ works, now Im just having a little problem with centralization...
Also why is it a bad practice?
All I will do with it is zoom in when the character is aiming and then go back to normal so it shouldn't be a problem.

The coordinates of the stage/root are based in the upper left, that's where 0,0 is to flash. The x and y axis extend down and to the right in the positive

As you zoom in you need to examine what point you're zooming to and adjust the actual x/y position of the stage to offset the shift the zoom causes, you would have to do this for any case where your zoom target isn't centered in the middle of the screen


89.

None

Topic: Programming Regs Lounge

Posted: 06/15/09 06:13 PM

Forum: Programming

At 6/15/09 05:05 PM, GOTHCLAWZ wrote: I'm the cyber pan handler! XD

knock it off, your sig is more than enough space for you to put your donation requests


90.

None

Topic: AS2 noob question...

Posted: 06/12/09 06:24 PM

Forum: Flash

At 6/12/09 06:06 PM, StaliN98 wrote: Damn, ninja'd. What he said.

yours actually works though, I forgot the extra params for attachMovie ;)


All times are Eastern Standard Time (GMT -5) | Current Time: 10:08 AM

<< < > >>

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