Recent posts by Rete on Kongregate

Flag Post

Topic: Game Programming / How do you do?

Hey there,

I know Rete said he doesn’t know programming, but I’m the programmer for his games so maybe I can give some quick tips. I should start by saying I code in AS3 using Flash Develop, so if you use AS2 or the Flash IDE, my technique might not be very helpful. Also, I apologize if I come across as condescending with my explanation. I don’t know how much knowledge you have in Flash, so I’m trying to be as basic as possible.

Firstly, his head and his body should be two separate movie clips. The head movie clip (MC) needs to be inside his body MC so that the head moves when the body moves. If you want something to happen when you click only his head, you need to add a script to the head MC that “listens” for whenever a mouse clicks on it. Here’s some example code (inside the head MC actionscript):

//This code adds an event listener that “listens” for whenever a mouse clicks the head.
//The first parameter passed into this function determines what type of event the movieclip is listening for. For ex. it can be click, double-click, when the mouse rolls over, etc.
//The second parameter is the function that you want to run after you have clicked the head MC.
//The rest of the parameters you don’t need to worry about.
this.addEventListener(MouseEvent.Click, FunctionToRun, false, 0 true);

function FunctionToRun(e:MouseEvent):void

//This removes the event listener (since I’m assuming you can’t click the head after it has exploded).
this.removeEventListener(MouseEvent.Click, FunctionToRun);

//Then you add whatever code you want for the head.
//Assuming you want to change frames of the head movieclip from a non-blown up to blown up state, you can use this code.
//This is assuming the head blown up picture is on frame 2 of the head MC.
(e.currentTarget as MovieClip).gotoFrame(2);

That’s about it. I hope it’s clear and best of luck.

Flag Post

Topic: Game Programming / Kongregate Stats Issues

Well I do that anyway. But it’s definitely not connecting.

I have another question. I have a custom preloader in a separate swf file that loads my game. Should I put the component file and instantiate it in the preloader instead of the actual game? I don’t think it should matter.

Also, I tried to put it in the preloader, but when I do that the game won’t load at all when I try to publish it. I removed all mention of the Kong API in the game, and only imported it and added the component to the stage of the preloader. But it still won’t load the game. I’m having a lot of trouble debugging this because it all works fine locally.

Flag Post

Topic: Game Programming / Kongregate Stats Issues

Hi there,

I’m having some problems getting the Kongregate API to work properly and would appreciate any help from folks. I got pretty far in it, but am getting stuck when trying to debug it on the site. Using debug_level=3, it keeps stalling on “Listening for connections…” and I can’t figure out what why.

I’m using AS3, and unfortunately support for that isn’t as strong as AS2. I imported the KongregateAPI component, and used this code:

if (kongregate.connected){
kongregate.stats.submit(“Award 1”,1);

And everything seems to work when I run it locally. The trace output says “Kongregate API: IStatServices.submitStat(Award 1,1)” but it just keeps hanging on the actual site. I also set up the stats on the game’s statistics page on the website.

Any ideas on why this is happening would be greatly appreciated.

Flag Post

Topic: Game Programming / [Kongregate API] AS2 Integration

I’m actually having a similar problem to CraigBrian. I’ve got as far as implementing the Kong API, but for some reason none of the stats I submit show up on the debug_level=3 page of the game. It just says “info:Listening for Connections…” and I can’t figure out what’s wrong with my code.

If I can get this fixed, I can help you out CraigBrian.