Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


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: 'Kajenx'

We found 552 matches.


<< < > >>

Viewing 61-90 of 552 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91419

61.

None

Topic: Impossibly fast particle system

Posted: 05/12/08 02:59 AM

Forum: Flash

Hey Gust, do you mind if I take a look at your AS for the examples you posted? A working example would help me a lot!

@ Jimmick: I'm doing research on this now so I can overhaul my next game with particles. Think Ether Cannon 2. :D


62.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 08:42 AM

Forum: Flash

Alright, so this is what the code looks like now:

var Width:Number = 550;
var Height:Number = 400;
var PTCCount:Number = 0;
var Points:Array = new Array();
var Radians:Number = Math.PI/180;

// Filter Stuff  
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.filters.BlurFilter;
import flash.geom.Rectangle;
import Particle;
var Rect:Rectangle = new Rectangle(0,0,Width,Height);
var BMD:BitmapData = new BitmapData(Width, Height, true, 0x00000000);
var LeFilter:BlurFilter = new BlurFilter(2, 2, 1);
var BM:Bitmap = new Bitmap(BMD);
Empty.addChild(BM);

addEventListener(MouseEvent.CLICK, Mousez);
function Mousez(event:Event) {
	var b:int = 0;
	for (b = 0; b < 1000; b++) {
		var TempAng:int = Math.round(Math.random()*359);
		var Temp:Particle = new Particle();
		Temp.XPos = root.mouseX;
		Temp.YPos = root.mouseY;
		Temp.XThrust = Math.cos(TempAng * root.Radians);
		Temp.YThrust = Math.sin(TempAng * root.Radians);
		Temp.Thrust = Math.random()*10;
		Points.unshift(Temp);
		PTCCount += 1;
	}
}

addEventListener(Event.ENTER_FRAME, Main);
function Main(event:Event) {
	var a:int = 0;
	BMD.applyFilter(BMD, Rect,new Point(0,0),LeFilter);
	BMD.lock();
	for (a = 0; a < PTCCount; a++) {
		BMD.setPixel32(Points[a].XPos, Points[a].YPos, 0xFF0088FF);
		Points[a].Main();
		if (Points[a].Thrust <= 0) {
			Points.splice(a,1);
			PTCCount -= 1;
		}
	}
	BMD.unlock();
	Count.text = PTCCount;
}

And the Particle class:

package {
	import flash.events.Event;
	public class Particle {
		public var XPos:Number = 0;
		public var YPos:Number = 0;
		public var XThrust:Number = 0;
		public var YThrust:Number = 0;
		public var Thrust:Number = 0;
		public function Particle() {
		}
		public function Main():void {
			XPos += XThrust * Thrust;
			YPos += YThrust * Thrust;
			Thrust -= 0.1;
		}
	}
}

And some links to play with it: Link and Like

I'll keep working on it, I've already learned a lot, but I need to get some sleep. Thanks for all the help! I'll check back here later.


63.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 07:59 AM

Forum: Flash

I don't think it's fair to say I don't understand the basics of actionscript. The problem is I don't speak programmer lingo, so when you start talking about iterators, scope, and stack, I don't know what you're referencing, even though I probably know the concepts through use. Like just last year a friend of mine asked me if I knew anything about algorithms, and I said no, but after he showed me his homework assignment I realized I did, in fact, know algorithms quite well...


64.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 07:28 AM

Forum: Flash

At 5/11/08 07:19 AM, GustTheASGuy wrote: Hash functions make it slower. They are used to make it quicker to get properties of objects when you don't know the type (instead of looping through an array of property labels to find the corresponding value). When you know the type, the compiler can resolve the hash before runtime. This is why you define classes. Instead of being a dynamic Object the compiler knows exactly what properties an instance has and their types.

OH! I think I get it. I mixed up the hash function and the linked list as I was reading. Anyway, what you're saying is, because I'm make each particle as an object at runtime it's slower than if I make a class at the start because flash has to use the hash to find out about the object instead of me just telling it right away.

I witnessed first hand how much the hashing was slowing it down already, too, because when I declared the a and b variables (as you pointed out) it sped up about 500%.

Wow, I think I learned a lot from this. Thanks a bunch!


65.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 07:01 AM

Forum: Flash

One thing doesn't make sense to me, though. Hash functions seem like they're aimed at finding things more quickly, but since I need to reference every particle on the screen, every time, why would it be any faster than a regular array?


66.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 06:56 AM

Forum: Flash

Heh, I think this is a bit deep for what little I know of classes. I get the concept, but I have no idea how to implement it, especially with AS3...

Thanks for the help, though. I'll keep reading.


67.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 06:17 AM

Forum: Flash

Ok I'm really trying to understand this (I'm not really a great programmer, so please excuse my noobishness :D), but if we apply those ideas to this instance, is it as simple as declairing a set length for the array (say 100,000) and using the push function to add new instances? Also, how would I go about removing dead particles; is the splice function slowing it down?

I'm looking up typed linked lists as we speak. I moved to AS3 to take advantage of the speed boosts, and I've always been a bit of a fanatic about optimization, so I really should become more familiar with this stuff...


68.

None

Topic: Impossibly fast particle system

Posted: 05/11/08 05:44 AM

Forum: Flash

Here's the code I've got.

var Width:Number = 550;
var Height:Number = 400;
var PTCCount:Number = 0;
var Points:Array = new Array();
var Radians:Number = Math.PI/180;

// Filter Stuff  
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.filters.BlurFilter;
import flash.geom.Rectangle;
var Rect:Rectangle = new Rectangle(0,0,Width,Height);
var BMD:BitmapData = new BitmapData(Width, Height, true, 0x00000000);
var LeFilter:BlurFilter = new BlurFilter(2, 2, 1);
var BM:Bitmap = new Bitmap(BMD);
Empty.addChild(BM);
var ColTran:ColorTransform = new ColorTransform(1, 1, 1, 0, 0, 0, 0, 0);

addEventListener(MouseEvent.CLICK, Mousez);
function Mousez(event:Event) {
	for (b = 0; b < 1000; b++) {
		var TempAng:Number = Math.random()*359;
		Points[Points.length] = new Object({XPos: mouseX, YPos: mouseY, XThrust:Math.cos(TempAng * Radians), YThrust:Math.sin(TempAng * Radians), Thrust:Math.random()*10});
	}
}

addEventListener(Event.ENTER_FRAME, Main);
function Main(event:Event) {
	BMD.colorTransform(Rect, ColTran);
	BMD.lock();
	for (a = 0; a < Points.length; a++) {
		BMD.setPixel32(Points[a].XPos, Points[a].YPos, 0xFF0088FF);
		Points[a].XPos += Points[a].XThrust * Points[a].Thrust;
		Points[a].YPos += Points[a].YThrust * Points[a].Thrust;

		Points[a].Thrust -= 0.1;
		if (Points[a].Thrust <= 0) {
			Points.splice(a,1);
		}
	}
	BMD.unlock();
	PTCCount = Points.length;
	Count.text = PTCCount;
}

69.

None

Topic: Sponsorship question

Posted: 05/11/08 05:42 AM

Forum: Flash

Look at the website Coaly posted, and shop the game around a bit. Post a site locked/protected copy on the net and send some emails to different portals asking if they'd like to bid on it. Don't be afraid to ask for more money, if a portal gives you a hard time about it they aren't reliable; when you're dealing with money, it's always best to be businesslike and try to get yourself the best deal. Your game sounds like it's pretty big, so you could get a very decent amount for it. I've had games sponsored from $500 - $5000; it's really about how much traffic it'll bring in for the sponsor. If it's going to be popular and spread to a lot of sites, then it's worth more.

The deal you described in the OP sounds legit, though. Most sponsorship involves adding the sponsor's branding and a few links into the game. It's important to keep the copyright on the game so you can make sequels and reuse code.


70.

Beaten

Topic: Impossibly fast particle system

Posted: 05/11/08 05:26 AM

Forum: Flash

I've been experimenting with AS3 and the bitmapdata class tying to duplicate this particle system, and I just can't figure it out. I can't even get close to the amount of particles he's making! He says in one of the comments he's just looping through an array, but you can get up to 80,000 particles and it still runs smoothly. I can hardly make it past 1000 on my attempt without my framerate dropping.

I tried turning off the part where it renders the pixel and just letting the math run, but it didn't affect it, which makes me think it's the actionscript slowing it down. Other than setPixel32, though, I only have 2 equations that add a bit to the X and Y to make it move. It seems like what he's doing is impossible!

Does anyone have any idea what he's doing?


71.

None

Topic: NG Flash Con

Posted: 05/07/08 10:33 PM

Forum: General

At 5/7/08 10:28 PM, Straight-Edge wrote: Well, seeing as how newgrounders are from all over the country (world), and most of them aren't even old enough to drive yet, the turnout would be downright shitty.

Haha, so that means the maturity level would be unprecedented for a NG related event!


72.

Elated

Topic: NG Flash Con

Posted: 05/07/08 10:26 PM

Forum: General

The title says it all. Why doesn't NG have a big get together in Philadelphia? They could announce the tank awards to a live audience, show popular movies on a big screen, have booths for popular Flash artists to sell some t-shirts and stuff.

That would be really fun.


73.

None

Topic: 100+ Cartoon Characters

Posted: 05/06/08 01:27 AM

Forum: Art

YOU CAN'T DRAW KIM POSSIBLE WITHOUT RUFUS!!!


74.

None

Topic: Tom Fulps picture

Posted: 05/06/08 01:24 AM

Forum: General

At 5/6/08 01:14 AM, Death-Affiliate wrote:
He may want surgery to remove those moles. He's rather spotty.

Especially the big nasty one in his armpit...


75.

None

Topic: AS Tutorial Sponsorship?

Posted: 04/20/08 04:56 PM

Forum: Flash

Hahaha, that sprite was way better than that other thing! Dude, stick with the sprites, it looks fine.


76.

None

Topic: Wana help me out

Posted: 04/20/08 04:51 PM

Forum: Flash

That last one is actually kinda cool, lol.


77.

None

Topic: Pay Rates For Flash Game Designers

Posted: 04/20/08 04:46 PM

Forum: Flash

At 4/20/08 03:11 PM, mulatto401 wrote: I've read the articles on that sponsorship site, very good reading. I'm new to the online flash game market and thats why I'm doing my research. Would I be wrong if I said the online flash mulitplayer market almost has no competition? Thats what my target market is.

Yes, but there's a reason for that. Flash just can't handle anything more intense than turn based multiplayer games. There have been quite a few multiplayer games, though. They aren't as rare as you might think.


78.

None

Topic: How could I develop this engine?

Posted: 04/20/08 03:56 AM

Forum: Flash

Remake the old Qbasic Gorillas game!


79.

None

Topic: Pay Rates For Flash Game Designers

Posted: 04/20/08 03:52 AM

Forum: Flash

Most game designers use the sponsorship model. You can learn a lot about it here.


80.

None

Topic: I hate Flash...

Posted: 04/20/08 02:38 AM

Forum: Flash

I have the same problem, but really, it's all about drawing. If you can't draw quickly and accurately, then practice that first. Save animation for later.


81.

None

Topic: Seamless AS3 root Solution

Posted: 04/20/08 02:15 AM

Forum: Flash

@ sspecter: Look, I never do anything more complex than for loops and if statements. Timeline programming is cheap and easy, and a dream for integrating with animation. I was trying to find a way to avoid having to deal with classes, which is why I was excited when I found this. I didn't realize Adobe had installed a Nazi mode, though, so thank you for the advice about that. It's seems to work like I want it to now.

It's comments like what you just said that have been killing me all day, though. Wading through a few tons of programmer spewage leaves me feeling all dirty and frustrated. I just want the simplicity of writing a piece of code and having it work the first time.


82.

None

Topic: Wana help me out

Posted: 04/20/08 02:01 AM

Forum: Flash

At 4/20/08 01:19 AM, MatthewB wrote: presumably 47 would be enough lol!

Erm, yeah, you're done with monsters...


83.

None

Topic: Seamless AS3 root Solution

Posted: 04/20/08 01:45 AM

Forum: Flash

At 4/20/08 01:33 AM, Moonkey wrote: By the way,

public function Ro() {
should be

public function ro() {

If you capitalize it, it's not the same as the class name and won't be called as the constructor, meaning ot never actually gets set.

Oh, thanks. I'm going to try using root without strict mode, though. If that works consistently I won't need the workaround.


84.

None

Topic: Happy Birthday Jazza

Posted: 04/20/08 01:27 AM

Forum: Flash

Hey, happy birthday! Only 19 and you're already a celebrity! :D


85.

None

Topic: Seamless AS3 root Solution

Posted: 04/20/08 01:23 AM

Forum: Flash

Oh, thanks for pointing that out. Strict mode is probably what's been killing me...

The main thing that's been holding me back with AS3 is the strange elietism that's grown up around it. I'm realizing now that I can do pretty much everything the same way I have been, whith virtually the same code, but I've been avoiding it because all of the "real programmers" have come in and said OOP is the only way to go. It's like everyone suddenly forgot Flash was an animation tool.

Anyway, as you can see, the best I could come up with after hours of searching was a useless workaround. Is there a case when I'll have to worry about root related errors if I'm not importing anything?


86.

None

Topic: Looking for a good Flash Book

Posted: 04/19/08 11:22 PM

Forum: Flash

I learned everything I know from this.


87.

None

Topic: AS Tutorial Sponsorship?

Posted: 04/19/08 11:15 PM

Forum: Flash

If it's a game, definitely. It sound like it could be a lot of fun!


88.

Elated

Topic: Seamless AS3 root Solution

Posted: 04/19/08 11:13 PM

Forum: Flash

For those of you who, like me, use timeline coding (as opposed to OOP) but still want to take advantage of the speed of AS3, the main problem in switching over has been the lack of a _root equivalent. I've spent hours researching it and finally found a really simple solution on the Kirupa forums. Here's how it works.

Step 1
Create a new actionscript file called ro.as, and copy the following code into it.

package {
import flash.display.MovieClip;
public dynamic class ro extends MovieClip {
public static var ot:MovieClip;
public function Ro() {
ot = this;
}
}
}

Be sure to save it in the same directory your .fla file is in.

Step 2
On the stage properties panel (make sure nothing is selected on the stage and you'll see it) in the Document Class field, type "ro" without parethesies.

Step 3
You can now access the root just like in AS2! The only difference is, instead of typing "_root.VariableName" you now type "ro.ot.VariableName".

How It Works
AS3 was reformulated using DisplayObjects, and because of this the root variable no longer always refers to the stage and main timeline. (It seems like it usually doesn't, actually...). So we basically have to make our own root. To do this, we make a movieclip, and put the whole flash inside of it (which is what the class is doing). That way, all of the stuff we do on the main timeline and stage can be accessed globally. By typing ro.ot, you're first defining the class name (ro) and then the movieclip name (ot).


89.

None

Topic: Pico Day Preloaders!

Posted: 04/18/08 05:26 PM

Forum: NG News

Awesome stuff! Thanks Tom & NG!


90.

None

Topic: Favorite Coffee Flavors?

Posted: 04/16/08 04:20 AM

Forum: General

Coffee is gross, I drink tea...


All times are Eastern Daylight Time (GMT -4) | Current Time: 07:34 AM

<< < > >>

Viewing 61-90 of 552 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91419