Be a Supporter!
Response to: [AS3] Array of falling objects. Posted October 9th, 2010 in Game Development

The easiest way is to loop thru your rain_array on every enterframe and remove the drops that are below the screen:

for each(var rainDrop:Object in rain_array){
     if (rainDrop.y >= stage.height){
        stage.removeChile(rainDrop);
        rain_array.splice(rain_array.indexOf(rainDrop), 1);
     }
}

Code is unchecked, but put something like that in your enterFrame event handler. When you're working with arrays, for and for/each loops are going to be your best friends.

Response to: The 10 Kb Game Challenge [as3] Posted October 9th, 2010 in Game Development

Just sent you a link to my fla/source Archawn, can't wait to see the compilation :)

Response to: Best thing to learn from? Posted October 8th, 2010 in Game Development

I don't know about flash MX, I've only ever used CS4 and CS5. But the thing that helped me learn actionscript the best was the in-program language reference. Again, I don't know about MX, but in CS3 if you type for example Array() into the action window, it will highlight blue. If you right click it and select help, it will take you to the command in the language reference and you can read all about it.

A good resource for AS3 is AS Gamer. I hope your team is using AS3, sure it seems harder than AS2, but it's really not. Tell us a little more about your team, and what in particular you are doing for it, I would love to hear about it.

Response to: String Value with Array.Splice? Posted October 8th, 2010 in Game Development

no, the index number parameter needs an interger

Response to: script issues... Posted October 8th, 2010 in Game Development

At 10/8/10 08:00 PM, egoraptorfreak1 wrote: if(time<=11){

If time is less than 11, then money + 0. If you want time is more than 11, you would use if(time>=11)

Response to: The 10 Kb Game Challenge [as3] Posted October 8th, 2010 in Game Development

Ok, here is Space Gold Farmer once more, but now with 100% more pixel perfect collision :P It's now clocking in at 8.1kb.

Any other suggestions?

Response to: The 10 Kb Game Challenge [as3] Posted October 7th, 2010 in Game Development

At 10/7/10 05:52 PM, Archawn wrote: The .AS file doesn't matter; all I care is that the SWF is less than 10KB and meets the other guidelines. So, if you would like to build on your idea, you have plenty of room to.

Aweome! I was going to tighten up the hit testing but I was unsure whether it was the .as or the .swf that had the 10kb limit. Now, I'm gonna go back and fix it :)

Response to: The 10 Kb Game Challenge [as3] Posted October 7th, 2010 in Game Development

Here's my entry: Space Gold Farmer

The as file is 9.99kb, the swf is 3.92kb. If you have a suggestion let me know, but I don't have much room left to play with anymore lol.

Response to: Problem removing particles Posted October 7th, 2010 in Game Development

Thanks man :) I knew I was forgetting something, but couldn't for the life of me think of what it was

Problem removing particles Posted October 6th, 2010 in Game Development

I'm trying to create a particle emitter, and everything is going well, except when I try to remove the particles.

What is happening is, I'm pushing all created particles into an array (partArr), then checking the y position of every particle in partArr every frame, if it is over 560 I push it into an array (remPart) to remove it. After the check, I call a function removeP which removes the particle from partArr, then finally removes the sprite from the parent. Unfortunately it seems that when the first particle in partArr gets removed, all the rest of the particles on screen stop moving. You can see the problem here.

Here are the two functions that are causing the problem:

function movePart():void {
			for each(var ob:Object in partArr) {
				ob.xv *= FRIC;
				ob.yv += GRAV * FRIC
				ob.sprite.x += ob.xv;
				ob.sprite.y += ob.yv;
				if (ob.sprite.y > 560) {
					remPart.push(ob);
				}
			}
			removeP();
		}
		
		function removeP():void {
			for each(var ob:Object in remPart) {
				partArr.splice(partArr.indexOf(ob));
				partCan.removeChild(ob.sprite);
			}
			remPart = [];
		}

Can anyone see a problem with my code? Could partArr.splice() be causing this? Thanks in advance!

Response to: Need menu for zombie shooter game Posted October 6th, 2010 in Game Development

Mokshal, the only thing I think you should change about your menu is have "Stay Dead" appear on screen faster, and lose the blur effect around the dripping blood. And that's only if you're absolutely determined to change something. It looks good as it is.

Response to: Mmo On As 2.0? Posted October 6th, 2010 in Game Development

At 10/6/10 07:54 AM, Makakaov wrote:
Wait, i have a free Lite version. Is using it free? I mean there were also other versions which you have to pay for, and i'm not sure if you didn't mean that.

So just to get it clear: Do i have to pay a licence for running a server on Smartfox Lite?

Smartfox lite only allows something like 10 connections at a time (but yes it's free). If you want 100's of people playing at once, like you said you wanted, you'll need to buy a license.

Response to: AS3 KeyboardEvent in a class Posted October 6th, 2010 in Game Development

It's in your main document class right? try stage.addeventlistener, then make sure you click inside the flash window first before you press the key. Also, when you test your movie in flash, click control at the top, and disable keyboard shortcuts.

Response to: Help please? Posted October 6th, 2010 in Game Development

Audacity exports MP3's too, right? Have you tried that instead of a WAV?

Response to: Does anyone else have this problem Posted October 5th, 2010 in Game Development

I don't know why your having this problem, but might I suggest you start using .png's instead of jpegs? Flash seems to work better with png's, so it might help your problem if you convert those jpegs.

Response to: Mmo On As 2.0? Posted October 5th, 2010 in Game Development

At 10/5/10 10:25 AM, Makakaov wrote:
I have downloaded Smartfox Lite version, and it has some nice examples i could learn from. Sadly, it looks pretty limited.

Yes it's limited but it allows enough connections to test it out with a few people on a home server, which is pretty much all you need at the moment.

My suggestions for you and your game: Learn AS3. If your going to try and do something as advanced as an MMO, you might as well use an up to date language. There is no excuse or good reason for sticking with AS2 on a project like this. The jump from AS2 to AS3 is not hard, and you'll find a lot more community help using AS3. And later on, if you decide you need to bring in another programmer, it's going to be easier to get someone who's competent instead of an AS2 script monkey that only knows how to copypasta.

Be prepared to spend money on this project. Right now you using smartfox, for a 100 user basic license that's going to cost you 200 Euro, (276$ US) and it only goes up from there. On top of that you will need server space. Or you could try the link that milchreis posted, you can get a usable plan there starting at 19.95$ a month and up depending on what you'll need.

Right now, I would suggest you start working on the client side part, and figure out your games engine (even if you have to make it single player for the moment). This will give you a better idea of what data you'll be needing to send back and forth to the server. Also, don't just try, but DO code in OOP so your code will be easily reusable, and understand.

Response to: Flash App - faking a database? Posted October 5th, 2010 in Game Development

What you're doing is way way way above my programming level, but...

If you are making this app for a specific site, why not contact that site, tell them what you are doing and see if they can help out? Best case scenario, they give you some server space, maybe make an API to help out. Worst case, they say no, so no big loss.

Response to: Need some tips on flash game builds Posted October 5th, 2010 in Game Development

At 10/5/10 11:09 AM, zrb wrote:
At 10/5/10 04:43 AM, willemvh wrote: - how do you know if your on the right track for good gameplay ?
- is 800*600 a to large format ? should we opt for a smaller one ?
That is considered usually the maximum size your game should be since some sites won't accept larger sizes, but generally, you should try to keep it under that. 640x480 is usually perfect.

From my experience most sites don't want a game that's over 700x700. 640x480 is a good size tho.

Response to: pick random option. Posted October 5th, 2010 in Game Development

At 10/5/10 03:24 AM, Fion wrote:
At 10/5/10 02:36 AM, sasuke2910 wrote: Basically use Math.ceil(Math.random() *4);
Math.ceil(#) Round a number up
Just multiply your random number by 4 then round it up. Then you've got a random number between 1-4
If you do Math.ceil(Math.random()*4); there's a chance(very very small) of getting 0. You should use:

Math.floor(Math.random()*4);

This way you will always get a number 1-4 avoiding getting any errors a user might recieve on the off chance they it returns zero.

No, if you use Math.floor() it will round down to 0 if the random number is less than 1. Math.ceil() rounds up, if you get less than 1 in your random number, it will round up to 1, making getting 0 impossible. Since Math.random() * 4 will never give a higher number than 4, math.ceil won't round to 5 either, but floor() will round all numbers down to 3 if it's not 4 exactly. Go ahead and check it with this code:

for(var i:int = 0; i < 100; i++){
     if(i == 0){
          trace("Start Math.ceil() number generation")
     }

     var ranNum1:int = Math.ceil(Math.random() * 4);
     trace(ranNum1);

      if(i == 99){
          trace("End Math.ceil()");
     }
}


for(var i:int = 0; i < 100; i++){
     if(i == 0){
          trace("Start Math.floor() number generation")
     }

     var ranNum2:int = Math.floor(Math.random() * 4);
     trace(ranNum2);

      if(i == 99){
          trace("End Math.floor()");
     }
}
Response to: Hitting object in shooter game prob Posted October 5th, 2010 in Game Development

At 10/4/10 11:15 PM, YoinK wrote: such tutorials exist on "perfect collision"? do you have such a link?

Here you go. Not a tutorial, so much as it is heavily commented code with an explanation of the concepts used and links to other resources in both AS3 and AS2. A lot of info on pixel perfect collision can be found here if you take the time to look thru the code and understand it.

Response to: pick random option. Posted October 4th, 2010 in Game Development

You could try something like:

var ranNum:Number = Math.ceil(Math.random() *4);

switch (ranNum){

     case 1:
     option1();
     break;

     case 2:
     option2();
     break;

     case 3:
     option3();
     break;

     case 4:
     option4();
     break;
}

You can find more info on switches here: Switch Statements. Hope that helps a little.

Response to: Moving from C++ to AS3? Posted October 4th, 2010 in Game Development

At 10/4/10 12:19 AM, UknownXL wrote: I dont understand?

From Wiki:

In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture. The word "low" refers to the small or nonexistent amount of abstraction between the language and machine language; because of this, low-level languages are sometimes described as being "close to the hardware."

AS3 is a high level language because it runs thru many different layers of abstraction. Your actionscript goes to the virtual machine in flashplayer, flashplayer sends instructions from your code further down the line, ect. ect. I'm sure someone can explain it better, but that's the gist of it.

Response to: Sponsorship Question Posted October 3rd, 2010 in Game Development

At 10/3/10 08:47 PM, BLUNTxMAN412 wrote: What is FGL?

flashgamelicense.com

Response to: Brainstorming Dilemma Posted October 3rd, 2010 in Game Development

At 10/3/10 11:03 AM, Left4DeathInFire wrote: going into the designing without a decent storyline would be MADNESS!

I think you should figure out what you want from your engine first, personally. Get your engine up and running and give yourself the ability to easily add NPC's, monsters, weapons, items, figure out your battle/inventory/leveling systems, ect. and once that is done you'll have a better idea of how to use your engine to tell your story, whatever it is.

One other thing: Mario? Like Nintendo's Mario? I wouldn't worry to much about a story until you guys can create some original characters.

Response to: My Final Fantasy Engine So Far Posted October 3rd, 2010 in Game Development

Delete or move the old SWF (manually, outside of Flash) and try to test movie again.

One suggestion for your engine: The most annoying thing that I find reoccurring in many, many RPGs is not being able to walk thru NPCs. This gets doubly annoying when those NPCs move around because they have a habit of blocking you in hallways and what not. I was originally going to say that when you walk into the NPC's purple hair the hair flashes in the characters face, and when you walk onto the npc from the top your characters feet end up in his face, but I think it all could be solved by just letting the player character walk over the guy :P

Response to: Remove Children, Stop Lagging (as3) Posted October 2nd, 2010 in Game Development

Sorry, I meant to say, last box made with that function, not for loop.

Response to: Remove Children, Stop Lagging (as3) Posted October 2nd, 2010 in Game Development

Your problem is in this part:

private function launch_boxes(e:Event):void 
		{
			
			var box_up:FlyingBox = new FlyingBox("UP");
			
			SoundMixer.computeSpectrum(ba, true, 0);
			
			for (var i:int = 0; i <= 512; i += box_spacing)
			{
				addChild(box_up);
				box_up.x = (ba.readFloat() * i) - 10
				box_up.y = 510
			}			
			
			if (box_up.y = 0)
			{
				box_up.Kill();
			}
			
		}

When your if statement does box_up.Kill() it's only doing it to the last box that was made in the for loop. What you should do is push each new box into an array and run your checks against the array instead of trying to use only 1 variable.

Response to: Tablet settings in Flash? Posted October 2nd, 2010 in Game Development

When you select pencil or brush tool you have this at the bottom of your tool panel, use Smooth, right now you're probably on Ink.

Tablet settings in Flash?

Response to: Bitmap data and transparency? Posted October 2nd, 2010 in Game Development

At 10/2/10 02:38 AM, Masterchief2219 wrote: Yeah, just import the image as a .gif or .png with a transparent background.

Well... I feel dumb. I assumed bitmapdata needed bitmaps... so I saved everything as .bmp. Ha, thanks man :)

Response to: Undefined property is... undefined? Posted October 2nd, 2010 in Game Development

If the code is exactly like you posted, there is no end bracket on the for statement, other than that, it works fine for me. The problem could be somewhere else.