Recent posts by ssjskipp on Kongregate

Subscribe to Recent posts by ssjskipp on Kongregate

avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Kongregate / Are Android games free to download?

Sometimes. Way off topic though.

You can pretty much set your own price, make it free, have ads (AdMob), whatever.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Objects in arrays in AS2

Example you’re looking for:

var myObj = new Object();
var myArr = new Array();
myArr.push(myObj);
// Now you can do stuff like:
myArr[0].nam = "Being";
myArr[0].stat2 = 5;
myArr[0].stat2 = 8;

Note that myObj is still a reference to the object, so changing myObj will change the object that myArr[0] is referencing.
If you want to create an array of objects, you can simply do something like:

var array = new Array();
function addObject(){
array.push(new Object());
}
 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / How friction changes when the Dude (Player) stands on a moving tile... ??[SOLVED]

Make sure you have a difference between air and land friction. When you’re on the tile, however, you have tilespeed + whatever else. Kind of like a base force then you move on top of that.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / AS3 Overloading functions

Overloading is retarded.

**Edit

Let me expand on that. Overloading is, among other things, one of the problems with Java.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Platform Warzone

BitmapData, Draw and erase.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Useful for AS3 game developers.

Here, I found this a little while ago, and I’m not seeing anyone really mention it.

http://code.google.com/p/polygonal/wiki/DataStructures

Basically, if you don’t feel like clicking the link, it’s a library of data structures that are particularly useful for game development.

Description from their site:

Formerly known as "AS3 Data Structures For Game Developers (AS3DS)",
the package contains parametrized classes that allow programmers to easily
implement standard data structures like linked lists, queues, stacks or
multi-dimensional arrays. The result is somewhere in between the C++ STL
(Standard Template Library) and the Java Collection framework. The library is
highly optimized and uses advanced HaXe features like inlining or code
generation for parametrized classes through the haxe.rtti.Generics interface.
 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / AS3 (possibly) Rotation Problem

Probably because you’re firing before the other tween finishes. search up on overwrite, onComplete, etc.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Annoying Glitching Problem - AS2

Not really ‘wrong way’, what’s going on is this:
Array:
[0, 1, 2, 3, 4, 5]
Looping through 0 → 5:

for (i = 0; i < arr.length; i++){

Say you collide and remove the item at index 2. “i” in the loop is now 2, and the array looks like this:
[0, 1, 3, 4, 5]
And index 2 is now “3”, not “2”. And you’re at the bottom of the for loop, so i++. Now you’re looking at 4. You never checked 3.

So, to fix this, we loop through the array from end to start. That way, if you remove an element, it doesn’t change where in the array you are.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / BitmapData.Draw() Problems

Well, what’s happening is you’re testing against a minimum alpha of 0, so any pixel. Then you’re subtracting when it ‘hits’, which is after it erases that first layer, a layer of alpha 0 pixels.

 public function hitTest(firstPoint:Point, firstAlphaThreshold:uint, secondObject:Object, secondBitmapDataPoint:Point = null, secondAlphaThreshold:uint = 1):Boolean

firstPoint:Point — A position of the upper-left corner of the BitmapData image in an arbitrary coordinate space. The same coordinate space is used in defining the secondBitmapPoint  parameter.

firstAlphaThreshold:uint — The smallest alpha channel value that is considered opaque for this hit test.

secondObject:Object — A Rectangle, Point, Bitmap, or BitmapData object.

secondBitmapDataPoint:Point (default = null) — A point that defines a pixel location in the second BitmapData object. Use this parameter only when the value of secondObject is a BitmapData object.

secondAlphaThreshold:uint (default = 1) — The smallest alpha channel value that is considered opaque in the second BitmapData object. Use this parameter only when the value of secondObject is a BitmapData object and both BitmapData objects are transparent. 

See if that helps.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / camelCase vs. under_score

When I’m programming in Java/ActionScript, I use Camel Case
When I’m programming in C, I use underscore.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Whats wrong with this AS3 code?

First off, there is an edit button on your posts.

Second, where is “food” defined? An instance name? Is it on the same frame? Where!?

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Folder structure?

The names come from here:
Linklinklink

They’re just standard folder names in a Unix environment.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / (AS2)How to make a movieclip move in the direction it's rotated?

Okay, so, we know this, right:

Basic rules of trig.
Theta is in radians.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / AS2 or AS3

You know AS2 with “great depth”? Then you know AS3. If you’re so familiar with AS2, the transition will be quite a breeze. All you need to know is how to write a function, and if you’ve EVER programmed on a frame, you can do that. If you can’t write a function, then you really won’t get anywhere with procedural programming.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Arrays, Help !

An Array is kind of like a shopping list of variables. Doing that is like saying "level' has two values. One at level[0] which is 4, and one at level[1] which is 5.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Prediction... and some chaos. Prediction of chaos.

If you have a slow moving projectile and want to know what angle to fire at to hit the target, then it can get kinda’ hard. I’ll see if I can whip up an example.

As for AI, I’m actually working on one now. That has properties like emotion that impact their actions.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Heat Seeking Missile.

Trig is what you’re looking for.
Basics that you need to know:

If you figure the missile is at the vertex between A and C, and your target is at the vertex between C and B, and a is the X distance to your target and b is the Y distance to your target, you can figure out (given those properties) the proper rotation as well as movement along each axis.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Is it possible to embed a DS Emulator via Flash on my website??

In the sense that pertains to Flash, of course.
Like the Adobe Labs entry

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Code not working. Something obvious im sure. SOLVED

Where is that full code? And what’s with the leading {?

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Is it possible to embed a DS Emulator via Flash on my website??

Look up Alchemy.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / I need fresh eyes

And why’s that? It’s getting every child that has to be a subtype of DisplayObject (since getChild returns an instance of DisplayObject), yet it can be of any type thereof. If flash stores a reference to an object as a 32 bit unsigned integer in memory then it doesn’t matter what type the variable is set to, as long as it is an ancestor of the custom class.

In fact, typecasting it to a specific class, or forcing to give it a typing call, adds another frame into the stack where Flash has to first take in the variable and check to see if it is expressed as the class Upgrader, then if so explicitly express it as an instance of Upgrader. If you look at the as operation, it takes an * data type as an operand. So, by running that you’re adding an extra step into the equation.

In fact, the best thing for you to do would be:

var killer:Object;

Since Object is a dynamic datatype and superclass to all other classes.

By the by, Wordblind’s solution is fine. I’m just pointing out that it’s not a bad recommendation.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / I need fresh eyes

Don’t set killer to be DisplayObject, Upgrader, or any defined class. Do this:

var killer:*;
 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / Nice game... Nicer game... Great game... Greater game... Awesome Game!!!... Laggy Game =(

Okay. Well, possible causes for lag:
1. Flash’s rendering. Try to set some things to visible = false to not display them and see if it’s still laggy (Reason is so you know WHAT’S causing the lag. If it’s too much on screen at once, that can be a problem.)
2. Excessive For loops / long recursion calls.
3. Look for an excessive amount of event/function calls in each frame update. How mane enter frames are you using? How many redundant objects are there?
4. Excessive use of Math.sqrt and cos and sin (inside loops, etc).

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / childIndex problem (hopefully easy)

I don’t know the rest of your logic, but it looks like it wont run ‘pillarSmash’ until 1. Its got ‘imOnPillarTile’ as true, and 2. it’s ‘y’ is exactly 330.

 
avatar for ssjskipp ssjskipp 258 posts
Flag Post

Topic: Game Programming / AS3: Blurred TextField Issue

Use a fixed width font and don’t set things to half-width pixels and you should be good… Only whole number x and y values.