Recent posts by Khronosis on Kongregate

Flag Post

Topic: Game Programming / Creating a game with upgrades

Because you’re the original poster in the thread.

 
Flag Post

Topic: Collaborations / Actionscript 2 Programmer needed

Originally posted by MichaelS508:

but how is it better

http://stackoverflow.com/questions/1869416/advantages-of-actionscript3-over-actionscript2

 
Flag Post

Topic: Game Programming / Object Depth [AS3]

If you break the problem down into pieces, you’ll see it’s not so daunting.
Here’s some pseudo-code on how you may want to start approaching the problem:

for each child of the current object (hint: numChildren)
     add the child to an array (hint: getChildAt)

sort the objects in the array based on their "y" property (hint: read up on sorting methods)
(alternate hint: check the manual page NineFiveThree posted and look up Array's built-in sort method)

for each object in the array
     set the index of the object to its new array position (hint: setChildIndex)

Those 3 steps should be nothing scary individually, and the overarching problem will just be a simple matter of connecting it all together.

 
Flag Post

Topic: Game Programming / TCSCCT Versus and Co-op won't let me login.

This is the programming forum. Perhaps General Gaming would be a better place for this topic.

 
Flag Post

Topic: Game Programming / Want to make a Mod for Minecraft.

This should be helpful:
http://www.minecraftforum.net/topic/96862-creating-mods-modding-tutorials-21511


ErlendHL is right, though; you’ll need some knowledge of Java.

 
Flag Post

Topic: Collaborations / ideas for games first one to say the want it gets it

You’re better off learning how to program, draw or compose music (in other words: contribute).
Being an Ideas Guy™ won’t get you anywhere.

 
Flag Post

Topic: Collaborations / Looking for someone who can draw graphics for a game.

Originally posted by I_Like_Potatoes:

I’m not really sure what’s a Game Design Document

http://en.wikipedia.org/wiki/Game_design_document

 
Flag Post

Topic: Kongregate APIs / Unity Support

From the API Overview page

The API supports ActionScript 2 & ActionScript 3, as well as Javascript. Other web plugins
(Unity, Java, etc) are supported through the use of the Javascript version of the API.
 
Flag Post

Topic: Game Programming / Slowing down the preloader?

He’s referring to when you test the game inside Flash CS. The options won’t show in the actual Flash Player.

 
Flag Post

Topic: Game Programming / Free Music

Here’s a couple audio portals full of community-made music:


http://www.kongregate.com/collabs/sounds
http://www.newgrounds.com/audio/


Most of the songs are uploaded under the Creative Commons Licensing Terms, so as long as you give credit to the author and don’t try to sell the songs, you’re good to go.
http://creativecommons.org/licenses/by-nc-nd/3.0/us/

 
Flag Post

Topic: Kongregate APIs / Screen resolution and kickstarter

According to the FAQ

games have […] a maximum width of 800 pixels. There’s not a hard height limit but please keep it reasonable to make sure your game is still playable.

Edit: Too slow, UG :)

 
Flag Post

Topic: Kongregate APIs / developer

http://www.kongregate.com/forums/4-game-programming/topics/160453-how-to-make-flash-games-read-before-posting

 
Flag Post

Topic: Game Programming / Error in AS

Originally posted by sr2449:
if(movedirection = 1)

“=” is for assigning values.
“==” is for comparing values.

 
Flag Post

Topic: Game Programming / rsps test...?

According to Google it’s a RuneScape Private Server.

Perhaps this thread would garner more interest in the General Gaming or Runescape forum…

 
Flag Post

Topic: Collaborations / Anyone need a writer?

It’s highly recommended that you post samples or previous work in the thread.

 
Flag Post

Topic: Game Programming / Noob after some tips

Adobe’s ActionScript 3 Reference is your friend when you want to know all the properties and functions that are available to you.
For example, if you want to know all the functions the Math class offers, you have a nice list here:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Math.html


As for math, you should definitely brush up on high school trigonometry.

 
Flag Post

Topic: Game Programming / collision

If you’re going to use a radius around the player to determine if the block is close enough, you’ll want to use the Pythagorean theorem (simply, a^2 + b^2 = c^2), and compare “c” with your radius.

First, create a constant variable that will hold the value of the radius (“hitTestRadius”, for example).

Now, you’ll need to set up the Pythagorean theorem in your code. “a” will be the difference in x position between the player and block, and “b” will be the difference in y position. Solving for “c” will give you the length of the hypotenuse of the imaginary triangle created by “a” and “b”.

Setting up the theorem in code will end up looking something like this:

deltaX = blockArray[i].x – character.x;
deltaY = blockArray[i].y – character.y;
blockDistance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));

Finally, you simply compare blockDistance with the radius you assigned your player (“hitTestRadius”). If blockDistance is smaller, it has passed your distance test, and you can allow it to perform the hitTestObject.

Fitting everything into your code, it’ll end up looking something like:

for(var i:int = 0; i < blockArray.length; i++)
{
	deltaX = blockArray[i].x - character.x;
	deltaY = blockArray[i].y - character.y;
	blockDistance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
	if(blockDistance < hitTestRadius)
	{
		if (character.hitTestObject(blockArray[i]))
		{
			trace(“hit”);
		}
	}
}
 
Flag Post

Topic: Game Programming / collision

For starters, you’ll need an array to store all the instances of the violetBlock object.
Right now, you’re doing:

VioletBlock = new violetBlock();
and
if (character.hitTestObject(VioletBlock))
{
trace(“hit”);
}

The problem with this is that VioletBlock represents only the most recently created instance of violetBlock.
As you create each new instance of violetBlock, you’ll need to store the current value of VioletBlock into some array (“blockArray”, for example), then iterate through the array, checking for a collision between the player and each instance of violetBlock.

This will change your code to:

VioletBlock = new violetBlock();
blockArray.push(VioletBlock);
and
for(var i:int = 0; i < blockArray.length; i++)
{
if (character.hitTestObject(blockArray[i]))
{
trace(“hit”);
}
}

Of course this will result in a lot of hitTests per frame, so you may want to consider optimizing the collision detection by either:

a) only performing a hitTest if the block is within a short distance from the player.
b) using simple math instead of hitTest by calculating the difference between the player and block’s x and y positions to determine if an overlap is occuring.

 
Flag Post

Topic: Game Programming / random for as3?(solved)

Please read the manual:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Math.html


‘random()’ generates a number in the range 0 <= n < 1, so if you want a random number between 0 and 10, you would multiply the result by 10, as such:

Math.random() * 10;

 
Flag Post

Topic: Kongregate APIs / what format does my game need to be

Read the FAQ

We support Flash (swf) files, and Unity game files

 
Flag Post

Topic: Game Programming / Help with variables

You should consider buying a book. They tend to have better detail than online tutorials/videos.

Here’s an example of a good book on AS3:
http://www.amazon.com/Foundation-Game-Design-Flash-Foundations/dp/1430218215

 
Flag Post

Topic: Collaborations / Ultimate Pirates Online (recruitting)

This is going to end up exactly like your SkyCraft thread.

 
Flag Post

Topic: Collaborations / Help in english

Originally posted by SachaL:
Clik to move.
Don’t be touch.
Large targets brings more points.

Click to move.
Don’t get touched (or hit).
Large targets give (or award) more points.

 
Flag Post

Topic: Game Programming / [AS3] Game Key Events Not Responding [SOLVED]

Someone else might have more of an explanation, but this basically means the focus is set on something other than the game object.

A quick-fix is using this when you start the game:

stage.focus = this;

 
Flag Post

Topic: Game Programming / Advice just starting

It’s “addEventListener”, not “addeventlistener”.

Also, you can simplify “x = x – 10” into “x -= 10”.