Recent posts by talrnu on Kongregate

Flag Post

Topic: Game Programming / Will learning Flash help me learn C++???

IMHO, you should first learn programming in general, and then focus on a language if that’s your goal. All languages are essentially the same (they all boil down to the exact same set of assembly instructions for a given computer). You can fret over which language to start with, but if that gets you down then you’re focusing on the wrong target. The differences between languages are usually too subtle for an inexperienced programmer to understand anyway. The most noticeable difference is syntax, but this is easy to learn especially when you know how programs work in general.

I would focus more on accessibility than anything else. By that I mean you should worry about using a technology (language) which is well-documented, supported by a large number of thriving noob-friendly developer communities, and easy to compile and share for debugging and critiquing. By these measures, Actionscript (AS3 in particular, I believe) is a wonderful place to start programming. It’s extremely easy to learn, especially if you have even slightly respectable Google skills; you can compile any legal program very quickly and easily; and you can slap any functioning Flash program on the web instantly to share it with anyone you wish.

Learn to program in general. Learn to read language documentation. Learn to find people with whom you can share problems which you’re unable to solve on your own. Then focus on language specifics.

 
Flag Post

Topic: Kongregate Multiplayer Games / [Heroes of Gaia] Glitches/Bugs

I have a hood that says it improves my sulfur production by a factor of 3 (whatever that means), but when my castellan equips the hood my sulfur production isn’t affected. The same hood also says it improves gold production by a factor of 3, and when my castellan equips it my gold production does increase. So it seems this bug only affects non-gold resources…

 
Flag Post

Topic: Game Programming / Compile Time Constant

Ah, clearly irnub, thanks.

 
Flag Post

Topic: Game Programming / Timeline to Document Class

If you really really want to work with frames within the document class for whatever reason… google addFrameScript.

 
Flag Post

Topic: Game Programming / Compile Time Constant

Hey, so I have a function that receives a Point as one of its parameters. I’d like the Point to have a default value, but can’t declare the parameter as thePoint:Point = new Point(0,0) because that is obviously not a compile-time constant. Is there some other way to create a default point, so that this function parameter is still optional? (I’d hate to have to call ’new Point(0,0) every time I use this particular function)

 
Flag Post

Topic: Game Programming / displaying non-swf programs in flash

I’ve asked him already, he’s not interested in sharing. :( I understand, but I still want to know, and I’m just not figuring out on my own, so I just ask everyone else.

So as far as that iframe is concerned, does that mean Jagex had to get Kongregate to set up the page for Runescape special-like? Or can you use a swf as an iframe in some way?

 
Flag Post

Topic: Game Programming / displaying non-swf programs in flash

I hate to use this example as it’s likely to lead to a flame war, but consider Runescape. You can play it here on Kong, through a Flash player, but I know the game is Java-based. Skyboy’s Sky-Splorer web browser is another example, though some recent change in Kong’s mechanics has rendered Sky-Splorer inoperable indefinitely. Can someone explain how this works, or at least point me to the subject I’d need to Google?

 
Flag Post

Topic: Game Programming / document class

When you create a document class manually, is the code within the constructor the first thing to be executed when the .swf is loaded? Or does there have to be some kind of main method?

 
Flag Post

Topic: Game Programming / DisplayObjectContainer bounding boxes

Yeah, for example if I want to represent 1-point perspective, I’ll need to be able to transform a container’s bounding box into a trapezoid, with the shorter of the two parallel sides closer to the point of perspective. In theory, I could eventually extend this to a full 3-point perspective implementation – maybe not competition for the Unreal engine, but cool enough to brag about methinks. :)

All right, time to dig through Google for transformation tutorials!

EDIT: BOooooooo affine limitations.

 
Flag Post

Topic: Game Programming / DisplayObjectContainer bounding boxes

I’m trying to use the properties of displayObjectContainer coordinates to cheaply emulate perspective 3D. However, this requires that I have the ability to change the position of each corner of a container’s bounding box, independently of the other corners. I have a feeling this involves using the Transform class, but I don’t really know how. Anyone have any pointers?

 
Flag Post

Topic: Game Programming / Anti-Cheat Protection (Sticky)

amazing, phantasmagoria hasn’t ruined this thread. i must be special. :P

 
Flag Post

Topic: Game Programming / nested loops...nevermind.

You have a few typos, e.g. “1 += 1”, but I understand. I need an array because I also need to calculate the variance of the whole sample, and I also need to calculate the quantiles; both processes require access to each of the numbers that were generated to create the mean (finding quantiles also requires sorting the list of values, easiest to do with Array.sort()). Otherwise, my implementation can’t get much simpler. And, since this is the actual program (I don’t intend to use it in any other program for any reason ever), I didn’t put it inside of a function.

 
Flag Post

Topic: Game Programming / nested loops...nevermind.

Wow. I hope I can blame my error on lack of sleep… there isn’t a trace function being executed in the inner loop. So it does work, I’m just not seeing it. Damn.

 
Flag Post

Topic: Game Programming / nested loops...nevermind.

Yes, I’m doing a statistical analysis on the actual randomness of numbers generated by Math.random(). So, the larger the sample size, the better.

I know the inner loop only runs on the final iteration of the outer loop, because my trace calls say so. The trace function in the outer loop executes every iteration, but the trace function in the inner loop executes only on the last iteration of the outer loop.

I should mention that I just realized that I’m not re-initializing the sample array for each iteration of the outer loop, but changing that doesn’t fix my problem. Still, I’ll edit the above code to include that.

 
Flag Post

Topic: Game Programming / nested loops...nevermind.

For some reason (which I’m sure stems from some noob mistake), when I make one for loop nested inside another, the outer loop executes fine, but the inner loop only executes on the last iteration of the outer loop. Here’s my code, which you can just assume is added to the first frame on the main timeline:

var sample: Array = new Array();
var numCount:uint = 0;
var sampleCount:uint = 0;
var sampleSum:Number=0;
var sampleMean:Number=0;
var newNum:Number;

for(sampleCount = 0; sampleCount < 100; sampleCount++){
	trace("Sample "+(sampleCount+1)+": \n\t");
        sample = new Array(); //this line added during POST EDIT 1
	for(numCount = 0; numCount < 10000; numCount++){
		newNum = Math.random();
		sample.push(newNum);
		sampleSum += sample[numCount];
	}
}

sampleMean = sampleSum / sample.length;
trace("Sample mean for n="+sample.length+": "+sampleMean);

Does anyone see what could be going wrong here? Thanks in advance.

EDIT1: I added a line of code that was missing (see my next post for details)

 
Flag Post

Topic: Game Programming / AS3 - No support?

Games that report statistics to Kong are eligible for getting badges, or so I’ve heard. So if you write in AS3 and want badges, report relevant statistics (e.g. score at the end of each level) via the API.

 
Flag Post

Topic: Game Programming / Le Sigh

At the very least, if someone deletes their post, there should be a marker or empty post or something that tells observers that the content has been changed/deleted.

 
Flag Post

Topic: Game Programming / Suggestions

If you hit writer’s block, go play lots of other peoples’ games for inspiration. If you still can’t come up with anything original after an hour of playing a dozen or so games, find a simple one and try directly re-creating it. If you can re-create it, go on to improve it in some way, even if you don’t think it needs improving. Add features, or smooth the mechanics out, or something. Since it’s still inherently someone else’s game, you really shouldn’t try to publish or market it as your own even after changing it… but that’s not what this exercise was started for, so it shouldn’t bother you much.

It’s actually a good technique for any artistic endeavor. At the end, even if you still are without any original ideas to bring to life, at the very least you got very good practice in, and you also got some insight into how other people create things, which can change the way you look at problems in the future. In fact, I like doing this exercise just for these extra benefits, even if I’m not trying to find inspiration for a new project.

 
Flag Post

Topic: Game Programming / Le Sigh

Screw you guys, I love when people I’m posting with are afraid of looking like morons, remove their side of the conversation, and subsequently make me the moron (with schizophrenia, to boot).

 
Flag Post

Topic: Game Programming / Should I buy a Book?

The only way to know that would be to compare them to the livedocs; if you’re going to do that, you might as well rely on the livedocs from the getgo.

 
Flag Post

Topic: Game Programming / Much-Needed Kong Feature?

@FP: Says me! :P I mean that’s how it ought to work, IM_H_O. After all, the comment board isn’t exactly designed for public discussion. Of course it can be used that way, but it definitely seems like it’s designed for people to leave one comment. And since there are forums, it would make more sense to me for people to have discussions in the forums, rather than filling up comment boards with childish bickering that doesn’t always help the developer (which I believe is the chief use for comments).

At any rate, I don’t really care which comments are visible to the public and which aren’t; I just think you should have to give the game a rating before being allowed to view and contribute to the comment board. And in the same general area, I think you should only be able to vote once, and then if you change your mind later just retract your vote (instead of choosing a new value).

 
Flag Post

Topic: Game Programming / Should I buy a Book?

ActionScript books really are mostly useful for getting an introduction to the language; actually, most are written, it seems, to cater to people with minimal programming experience at all, regardless of language. Unless you enjoy wasting money, you will probably want just to get very comfortable with the livedocs and Flash help file. They not only contain explicit details on every part of ActionScript, but they provide many useful examples as well. Not to mention you can use the search function instead of thumbing through paper pages yourself. Plus, the livedocs, being “live”, tend to stay much more up-to-date than any paper literature.

 
Flag Post

Topic: Game Programming / [FAQ] Making Games. READ FIRST!

Did you even read the first few posts in this thread? Go do that; if you still have the same questions, you should give up Flash while you’re ahead. Well, I guess that would mean you’re without a head, but still…

 
Flag Post

Topic: Game Programming / Minor setback in Kong RPG game

It’s extremely difficult to help without specifics. When you say the shop appears elsewhere, where should it be in the first place? Is this problem occurring when you’re in a map mode, or during normal play? How does your program determine the location of the shop? Give us some more details.

 
Flag Post

Topic: Game Programming / bullet scripting

Think about how it works: no matter where the player’s ship is, whenever he presses the “fire” button, a bullet is shot from his ship straight upwards. That bullet travels from the ship until it either hits an enemy or leaves the play area.

This is one larger problem that can be easily solved if you break it into smaller problems. Some of the smaller problems include, “Where does the bullet start from?” and “Does the bullet need to disappear yet?” In this case, every one of the smaller problems are very easily solved by just looking at the live docs.

So think about it. If you can’t figure out what all the smaller problems are, ask your question again. If you figure out what all the smaller problems are, but you can’t figure out how they’re solved, then you need to go study tutorials.