Recent posts by player_03 on Kongregate

Subscribe to Recent posts by player_03 on Kongregate

avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Optimize Publication Time

Using the Flex compiler is a better option. It gets similar compilation times, but it also gives appropriate warnings. (You should really be using Flex and FlashDevelop for your code anyway.)

Haxe gives even better compilation times, but Flex is usually good enough.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Fastest way to generate this kind of noise

The first thing to do is try BitmapData.noise() and see if that’s fast enough.

If it turns out not to be, you can try these pseudorandom number generators instead: 1 2 3.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Trying to shoot from the hand of my character. Need a formula

var testA:Point = new Point(0, 0);
testA = xChar.rightHand.localToGlobal(testA);
trace("Point: " + testA);
 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Trying to shoot from the hand of my character. Need a formula

To be honest, it would be a lot easier to go with Draco’s solution.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Classes and keyboard

Originally posted by tonikovacic:

Also may i recommend not using timer event for game loop. It’s better using enter_frame event

I already suggested this, but Alexander seems to have ignored it.

Originally posted by SumGato:

I think they aren’t practical since if you have to change the frame rate at some point you have to rewrite almos everything to let it like it was.

As tonikovacic said, timers don’t degrade gracefully, whereas ENTER_FRAME listeners do. In other words, those framerate issues you’re worried about also happen with timers, except that you can’t fix them as easily.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / characters licences ?

Originally posted by Ace_Blue:

It seems to me that using protected IP is all drawbacks and no upside.

You get the benefit of not having to develop the characters’ personalities, and there’s a pre-built world for you to take advantage of.

Originally posted by Ace_Blue:

It’s not like anyone is going to play your game only because it includes, say, Naruto characters

Sure they will. Perhaps not that many people will, but fans of the show are likely to give it a shot in spite of its rating.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Classes and keyboard

Originally posted by AlexanderC4:

i’m in flash pro cs6 and i clicked Ctrl-shift-enter to go into debug mode

Did you select “Disable Keyboard Shortcuts” in the Control menu?

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Classes and keyboard

Originally posted by tonikovacic:

KeyboardEvent is triggered only if, in your case, document class have focus, so trace stage.focus

Not applicable. AlexanderC4 is calling stage.addEventListener(...), so keyboard events will be received regardless of stage.focus. (Yes, I tested this.)

Originally posted by Ace_Blue:

Make sure you’re compiling in debug mode. Traces don’t show in release mode.

Alexander: Assuming you’re using FlashDevelop, look for a box in the top toolbar that says “Release.” Click that and change it to “Debug.” (If it already says “Debug,” the problem is elsewhere, and you should probably put a trace statement in your mainGame function just to make sure it’s getting run in the first place.)

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / About curly braces

Originally posted by Ace_Blue:

And yes, curly braces are usually superfluous when they only embrace a single instruction

Unless you want to add a trace statement in there to see if that line of code is being run, in which case it’s convenient to have the braces already there.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / expecting rightbrace

package  {
	
	import flash.display.MovieClip;
	import flash.events.Event;
	
	public class GoldBar extends MovieClip {

		public function GoldBar(x:Number, y:Number) 
		{
			this.x = x;
			this.y = y;
		}
		
		public function moveDown():void
		{
			y = y + 2;
		}

	}
	
}

Also:

		public function MainGame()
		{
			army = new Array();
			
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
			
		}
		
		public function onEnterFrame(event:Event):void
		{
			if( Math.random () < 0.08 )
			{
			//etc.
 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / About curly braces

I prefer the second style. It just so happens to be the One True Brace Style.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / AS3 Rotation problems

You should really respond to your old thread rather than making a new one.

Now to follow up on my previous guess:

Double-check the timeline in the arrow movie clip, or whatever movie clip has multiple frames. Do any of these frames have an “a” on them? If so, post the actionscript on those frames.

If not, are there any movie clips within the multi-frame movie clip? Press ctrl+A on each frame, and check for any white circles in what you selected. If you find any, check their timelines for actionscript as well.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Rotating an Object with Multiple Frames

Sounds like you’re putting code on the timeline. As in, the code to move the arrow is on frame 1, and when there are multiple frames it doesn’t get executed enough. Or more likely, your “initialization” code resets the arrow’s position each time Flash reaches frame 1. The solution is the same either way: follow the directions here and here.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Best Flash version to target?

I don’t know for sure, but Kongregate users are probably more likely than average to keep their Flash Players up to date.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / AS3 weak referencing

By “the last two,” RTL_Shadow" meant “useCapture and priority.” You don’t need to understand them, but you do need to write “false, 0,” before “true.”

From the garbage collector’s perspective, removing the listener is equivalent to using a weak reference. However, it’s probably safer to use the weak reference, just in case for whatever reason your listener-removing code gets skipped.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / AS3 weak referencing

I don’t think I’ve ever seen code where useCapture was true or where priority was non-zero. In other words, ignore those two.

As for useWeakReference, you might want to look at how garbage collection works in AS3 to get a feel for what references mean. Especially play around with that simulator (the dotted lines are weak references).

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Five Player 'Pac-Man'

For the record, the “BEEP” issue is actually called “ghosting,” and not all keyboards experience it. (Though many do, so you shouldn’t build games that require lots of keys.)

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Serious Discussion / Gay Marriage

Originally posted by jhco50:

[…] don’t just trash everyone who disagrees with you. I know it is a democrat tactic to do so, but it is so childish to always act like a nincompoop.

Deliberate irony?

Originally posted by jhco50:

I think it may be a little known case, or made up.

The latter. It’s the same hypothetical case from the previous post. vikaTae was really commenting on how MaTTyTL called an FAQ a “study.”

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Serious Discussion / Gay Marriage

Originally posted by MaTTyTL:

[…] what makes you all arrogant assholes.

[…] the points you all bring up HAVE ALREADY BEEN ANSWERED

[…] you re so close-minded to what is right.

[…] I refuted all of your arguments and you have nothing left.

I don’t care which side you’re on; you shouldn’t be making claims like that. You aren’t the one to judge when your opponents’ arguments are refuted. That is a job for people outside the debate.

Originally posted by MaTTyTL:

At least where I debate people actually respect each other’s opinions and are looking to learn.

“Respect each other’s opinions”
Hadn’t you just finished calling your opponents wrong and arrogant?

“Looking to learn”
By your own admission you haven’t updated your position at all over the course of this debate.


To be fair, some of the people you’re arguing against seem to be about as close-minded as you (tenco calling you “crazy” comes to mind). And I’m not going to say it’s ok when they do it.

My whole point here is that, no matter which side you’re on, even if you know your side is right, you shouldn’t be so condescending.


So you say you understand your opponents’ position, and they don’t understand yours.

Instead of just repeating yourself hoping to drive your points through their thick skulls, try summarizing the core of their position for them. Then either they’ll see that you understand, in which case they’ll be more willing to listen to you, or they’ll see that you don’t understand, in which case they’ll let you know.


I’ll go first – your position is that:

• Marriage is primarily useful for raising children, whether or not procreation is involved.
• The other reasons for marrying – tax benefits, declaration of commitment, etc. – are not good reasons.
• Marriage should therefore be restricted to couples that can raise children and do a good job of it.
• Based on certain studies, homosexual couples do a poor job of raising children.
• Therefore, homosexuals should be prevented from marrying.

You would reverse your position given sufficient evidence that homosexuals make good parents. You will not update your position otherwise.


Does that sound about right to you?

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Serious Discussion / Gay Marriage

Originally posted by MaTTyTL:
Originally posted by ExemplaryReturns:

I think that marriage should only be for making babies.

People should be forcefully married if they get pregnant. Infertile couples shouldnt be able to get married. When a couple becomes too old to make babies, they should be forced to divorce.

MARRIAGE IS ONLY FOR MAKING BABIES AND NOTHING ELSE!!!!

Lulztroll

Not so much a troll as a reductio ad absurdum, and a successful one at that.


If you want to claim that…

Originally posted by MaTTyTL:

Procreation IS the most important factor in marriage. If it wasn’t then there would be NO POINT IN GETTING MARRIED.

…then it follows, as ExemplaryReturns said, that infertile couples shouldn’t be allowed to marry.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / FlashDevelop compiling with wrong args

It’s probably in Project → Properties → Compiler Options → Additional Compiler Options.
However, it’s also possible you’ve got it set up to use a .hxml file, in which case you should check the file in question.
It doesn’t look like you’re using NME, but in that case the problem would be in the application.nmml file.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / simple AS3 code help

It turns out that using frames, motion tweens, and so on is a bad idea. It’s better to control everything via code, because even though code is harder to set up, it is easier to modify. Here is a tutorial that demonstrates the correct way to do things.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / Cursor on top

Ok, just to clarify a little: By default, objects are drawn in the order they are added to the stage. That means your cursor will go behind anything that was added afterwards.

Fortunately, you have more control than that. Actionscript has a “display object hierarchy,” which basically means you can put objects into groups. These groups are drawn in the order they are added to the stage. Just like regular display objects. In fact, they are regular display objects.

So if you make a group for your monsters and add that to the stage, and add the cursor after that group, your cursor will appear after everything in that group. The final step, of course, being to make your spawn code add monsters to that group rather than directly to the stage.

It’s less important whether this group happens to be a Sprite (as suggested by Evan) or a MovieClip (as suggested by GameBuilder), or whether you add it using code or by dragging it to the stage in Flash Pro.
Using code is better in the long run, and it’s what Senekis was referring to when he said “Use classes, FD, etc.,” but until he explains it in more detail, you can just ignore the suggestion. (Senekis: just because you explained in the past doesn’t mean Alexander has any idea what you’re talking about.)


One more clarification: feartehstickman’s suggestion refers to your ability to add objects before previously-added objects. You can specify where a monster should be added to the display object array, and specifying numChildren - 2 would add the monster as the second-to-last object.
This would work as long as your cursor was the very last object, but it would break if you wanted other things to appear on top of the monsters, so the “grouping” suggestions are far better.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / [AS3] Here's a new one... TextField.displayAsPassword

Originally posted by Senekis93:

Do you have a link where it explains the whole dot instead of asterisk thing?

Actually, no. I just thought I remembered seeing dots instead of asterisks, but it looks like I was wrong.

 
avatar for player_03 player_03 1249 posts
Flag Post

Topic: Game Programming / [AS3] Here's a new one... TextField.displayAsPassword

Originally posted by Senekis93:

+1 to the «Did you mean loginScreen.pTxt.displayAsPassword = true;» suggestion.

-1. If he was referring to the wrong object, the text wouldn’t be appearing and disappearing. Maybe they’re the same object? In any case, this sounds exactly like an embedded fonts issue.

I’m pretty sure Flash uses a dot character rather than an asterisk for passwords, so try embedding • and seeing if that helps.
I have no idea if that’s the correct dot character, though, so maybe you should start by embedding all characters. See if embedding really is the issue before trying to figure out which character is right.