Recent posts by CaptianKirk on Kongregate

Flag Post

Topic: Game Programming / Is there a website to get graphics/sounds/music/etc for free?

A good music resource is danosongs.com
I’ve used this source a lot and his music is royalty free with attribution. A lot of his music is really good for games, in my opinion. But not all of the songs loop well.

EDIT: Attribution in this case means linking back to his website.

 
Flag Post

Topic: General Gaming / Need help figuring out the title of an old N64 Game

I can’t figure out the name of my favorite racing game for nintendo 64. It was a long time ago, and I haven’t thought of it for like 7 years. In this game you could customize your car before the race with wings and other things. You would deploy the wings with the z key.
There were several modes including a battle mode and a stunt mode and race mode. In Stunt mode you would perform jumps and do trick and score points. In battle mode you had several weapons to get that would be gotten through power ups. Also the game had cars with jet turbines in the back.

 
Flag Post

Topic: Off-topic / Need help figuring out the title of an old N64 Game

Also, this game had amazing graphics for the time period. Real curved surfaces and the like. The menu even had 3d stuff on it. The little touches that you don’t see anymore.

Edit: Nostalgia might be making me look at it though rose-colored glasses.

@Hokage4354
Wikipedia didn’t have it listed. I think the game was really obscure.

 
Flag Post

Topic: Off-topic / Need help figuring out the title of an old N64 Game

I just looked up F-Zero and I’m pretty sure it’s not that. The cars in the game I’m thinking of didn’t float on the ground, they had wheels.
I know that there was a squeal to the game.

 
Flag Post

Topic: Off-topic / Need help figuring out the title of an old N64 Game

There were a lot more games, than just super mario 64. Super Mario 64 was the best of the mario games. In my opinion at least.

 
Flag Post

Topic: Off-topic / Need help figuring out the title of an old N64 Game

Recently I thought of this old game, I had for the Nintendo 64. I was little when I had it, and the system broke, and all my games for it got to who knows where. Now I have a Nintendo 64, and I want to play that game again, but I can’t think of the title.
It was a racing game, really futuristic. It had a regular race mode, stunt and battle modes. Only a few cars, and the UI had an odometer. Also, you could customize the cars with wings and nitro. Some of the cars had a jet engine in the back.
if anybody knows the name of this game, please reply.

 
Flag Post

Topic: Game Programming / Massive Map Problem - AS3

@Elyzius
Is “Battle Screen Class” referring to the map’s class or the document class? I think it refers to the map’s, and that’s what I tried. But, it kept returning the AS3 Error #1009. Personally, I think it has something with how to declare the map as a sprite.

 
Flag Post

Topic: Game Programming / Massive Map Problem - AS3

I don’t think you understand quite what I mean. I want the player’s coordinates to act as the rotation point for the background.

 
Flag Post

Topic: Game Programming / Massive Map Problem - AS3

I’m working on an Airplane Dogfighting game from the top-down viewpoint. I want the player remain stationary on the stage, while the map rotates and moves around the player. And the enemies will be moved with the map.
The problem is I don’t know how to change the rotation point of a MovieClip with code. Could someone Help?

 
Flag Post

Topic: Game Programming / Cursor Below Enemies - Need Help

Originally posted by Aesica:

Anti-AS2 comments aside, you can fix this easily by using containers instead of simply tacking everything onto root. So:

// do this only at the beginning when intializing your gamefield.  You should actually probably declare them as private, up at the top (or public if your code is messy)
var mEnemyContainer:MovieClip = _root.createEmptyMovieClip("enemyContainer", _root.getNextHighestDepth());
var mCursorContainer:MovieClip = _root.createEmptyMovieClip("cursorContainer", _root.getNextHighestDepth());

// ...later on

// the cursor will always be above the enemies, no matter how many enemies you try to attach.
var someCrappyEnemy:MovieClip = mEnemyContainer.attachMovie("Goblin", "Goblin" + mEnemyContainer.getNextHighestDepth(), mEnemyContainer.getNextHighestDepth());

My custom cursor is controlled by frame code. It’s based off of the root. How would I make the previous code work? Also, how would I have the enemies spawn with the previous code, because I’m using the attachMovie method in an external class to attach enemies?

Mouse.hide();
onMouseMove = function()
{
	cursor._x = _xmouse;
	cursor._y = _ymouse;
}
 
Flag Post

Topic: Game Programming / Cursor Below Enemies - Need Help

The custom cursor I’m using for my game is always below spawned objects(the enemies). I don’t know how to fix this. To attach the enemies, I’m using the attachMovie method with getNextHighestDepth. I was thinking about using the swapdepths method, but I have no idea on how to use that. The cursor is on the stage to begin with. I am using AS2. Please Help.

 
Flag Post

Topic: Game Programming / Text into infinity

In the intro movie for my game, I need to have some text marching into infinity. Kinda like the into for star wars. But, I don’t know how to make it look right. I have the publish settings for as2, so no 3d rotation. Could someone tell me how to do this?

 
Flag Post

Topic: Game Programming / Remove animation after completion

Originally posted by BigJM:

Is the Egg added at runtime or in the IDE?

The egg is added at runtime.

Also, why would a removeMovieClip() not work?
 
Flag Post

Topic: Game Programming / Remove animation after completion

I tried adding the removeMovieClip(). It still doesn’t work, At the end it just sticks to the player and repeats again into infinity.

 
Flag Post

Topic: Game Programming / Remove animation after completion

It was in the last frame, but I removed it when it wasn’t working. Would it have worked?

 
Flag Post

Topic: Game Programming / Remove animation after completion

Originally posted by DrYoshiyahu:

I hate telling anyone to code on the timeline, but what you can do is simply remove the movieclip on the movieclip’s last frame.

I tried doing just that with this code at the last frame of the movieclip.

removeMovieClip(this)
Originally posted by BluePriest:

put a trace in to make sure its even registering that the current frame is == to the total frame


if (this._currentframe == this._totalframes)
		{
trace('current == total');
			this.removeMovieClip();
		}

Im guessing you have it stopped because this IS the explosion? and the egg explodes once it hits something?

Originally posted by BluePriest:

put a trace in to make sure its even registering that the current frame is == to the total frame


if (this._currentframe == this._totalframes)
		{
trace('current == total');
			this.removeMovieClip();
		}

Im guessing you have it stopped because this IS the explosion? and the egg explodes once it hits something?

I used the trace. It returned: “current == total”

Thanks

 
Flag Post

Topic: Game Programming / Remove animation after completion

I can’t remove an animation when it’s finished. It’s all written in AS2. The object is like a missile. I’m trying to get the animation to start when the object hits the player or falls to the ground. Then remove itself after the animation completes. But, it won’t remove itself. Help!

Here’s my code:

class Egg extends MovieClip
{
	var hit:Boolean = false;

	function onLoad()
	{
		stop();
	}

	function onEnterFrame()
	{
		if (this._currentframe == this._totalframes)
		{
			this.removeMovieClip();
		}
		if (hit == false)
		{
			this._y += 10;
		}
		if (hit == true)
		{
			this._x = _root.player._x;
		}
		if (this.hitTest(_root.player))
		{
			play();
			if (hit == false)
			{
				hit = true;
				this._y + 40;
				_root.player.updateHealth(-10);
			}
		}
		if (_y > 500)
		{
			play();
			hit = true;
		}
	}
}
 
Flag Post

Topic: Game Programming / NumericStepper. Need Help! [AS2]

OK, I did what you said, how come in my trace:

trace(x1)

The value comes up as “undefined”. How do I get it to return a real number value?

 
Flag Post

Topic: Game Programming / NumericStepper. Need Help! [AS2]

I’m trying to make a distance formula solver program, formula(square root of (x2 – x1)^2 + (y2 – y1)^2), and to make it I’m trying to use a NumericStepper and fetch it’s value. How do I fetch’s value properly? I would to use a class file because that’s what I’m used to but fully explained frame code would be fine.
Here’s the way I was trying to get the value:

class Answer extends MovieClip
{
	var x1:Number;
	var x2:Number;
	function onLoad()
	{
		x1 = _root.valX1.NumericStepper.value;
		x2 = _root.valX2.NumericStepper.value;
	}
}

This class is for the MovieClip with the answer in it. It has some text along with dynamic textbox on the same layer.

 
Flag Post

Topic: Game Programming / Making a "onMouseDown = function()" repeat

I didn’t copy&paste any code except for the frame code which I am not using. I’m only using the class file.
And I do know what’s going on my code.
Also, have you even written any actionscript, because I don’t see any games on your profile, NineFiveThree?

 
Flag Post

Topic: Game Programming / Making a "onMouseDown = function()" repeat

I need to make an gun in my game so that when the left mouse button it starts shooting until the button is released. This is all as2.
I ported some frame code to class files. I didn’t write this frame code, I only ported it to class files. Also I only included 1 of the classes.

Frame Code:

/** 
* Game Engine - Shooting Projectile Bullets 
* 
* Version: 1.1 
* Author: Philip Radvan 
* URL: http://www.freeactionscript.com 
*/ 

//Settings 
var bulletOffset:Number = 10; //pixels - bigger number = less acurate 
var bulletLifeTimerTotal:Number = 20; //fps 
var bulletSpeed:Number = 10; //pixels 
var reloadSpeed:Number = 200; //ms 1000 = 1 second 

//Declare variables that we're going to be reusing 
//(this saves them in memory thus speeding everything up a little) 
var reloadTimer:Number; 
var reloadComplete:Boolean = true; 
var bulletAngle:Number; 
var randomNum:Number; 
var playerX:Number; 
var playerY:Number; 
var rotationDirection:Number; 

/** 
* 
* Fire Weapon 
* 
*/ 
function fireWeapon():Void 
{ 
    //check if weapon is reloaded, if true, fire bullet 
    if(reloadComplete == true) 
    { 
        //attach bullet 
        var bullet_mc:MovieClip = _root.attachMovie("bullet", "b"+_root.getNextHighestDepth(), _root.getNextHighestDepth()); 
     
        //position bullet on player 
        bullet_mc._x = player_mc._x; 
        bullet_mc._y = player_mc._y; 
         
        bullet_mc.bulletLifeTimer = 0; 
         
        //calculate random bullet offset. 
        randomNum = random(bulletOffset)-(bulletOffset/2); 
     
        //set bullet firing angle 
        bulletAngle = ((player_mc._rotation+randomNum-90)*Math.PI/180); 
        bullet_mc.xSpeed = Math.cos(bulletAngle)*bulletSpeed; 
        bullet_mc.ySpeed = Math.sin(bulletAngle)*bulletSpeed; 
     
        //make it move 
        bullet_mc.onEnterFrame = function() { 
            //move bullet              
            this._x += this.xSpeed; 
            this._y += this.ySpeed; 
            // 
            //check if  bullet needs to die of old age 
            if (this.bulletLifeTimer>=bulletLifeTimerTotal) { 
                this.removeMovieClip(); 
            } 
            //update bullet timer 
            this.bulletLifeTimer++; 
        }; 
        //start reloading gun 
        startReloading(); 
    } 
} 

//start reloading weapon 
function startReloading() 
{ 
    reloadComplete = false; 
    //set a timer that will call the gunReloaded function after "reloadSpeed" time passes 
    reloadTimer = setInterval(this, "gunReloaded", reloadSpeed); 
} 
//gun reloaded function - clears timers and sets reloaded to true 
function gunReloaded() 
{ 
    clearInterval(reloadTimer); 
    reloadComplete = true; 
     
} 

//Rotate Player 
function rotatePlayer() 
{ 
    //update our player location parameters 
    playerX = player_mc._x; 
    playerY = player_mc._y; 
     
    //calculate player_mc rotation, based on player position & mouse position
    rotationDirection = Math.round(180 - ((Math.atan2(_root._xmouse - playerX, _root._ymouse - playerY)) * 180/Math.PI)); 
     
    //set rotation 
    player_mc._rotation = rotationDirection;     
} 

/** 
* 
* Mouse Controls 
* 
*/ 
//create an object that we'll listen to 
mouseListener = new Object(); 

//on Click, fire the weapon 
mouseListener.onMouseDown = function() { 
    fireWeapon(); 
}; 

//on mouse move, rotate the player 
mouseListener.onMouseMove = function() { 
    rotatePlayer(); 
} 

//add listener 
Mouse.addListener(mouseListener);

Now here’s the code I used:

class Turret extends MovieClip
{
	var reloadTimer:Number;
	var reloadComplete:Boolean;
	var turretX:Number;
	var turretY:Number;
	
	function onLoad()
	{
		reloadTimer  = 10;
		reloadComplete = true;
	}
	function onEnterFrame()
	{
		rotateTurret();
		onMouseDown = function()
		{
			if (reloadComplete == true)
			{
				var bullet = _root.attachMovie("bullet", "b" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
				bullet._x = this._x;
				bullet._y = this._y;
				reload();
			}
		}
	}
	function reload()
	{
		reloadTimer = setInterval(finshedReloading, reloadTimer);
	}
	function finshedReloading()
	{
		clearInterval(reloadTimer);
		reloadComplete = true;
	}
	function rotateTurret()
	{
		turretX = this._x;
		turretY = this._y;
		var rotationDirection = Math.round(180 - ((Math.atan2(_root._xmouse - turretX, _root._ymouse - turretY)) * 180 / Math.PI));
		this._rotation = rotationDirection;
	}
}
 
Flag Post

Topic: Game Programming / Custom Cursors using Classes AS2 Help

Yes, I checked the box “export for actionscript” and filled in the class field.

 
Flag Post

Topic: Game Programming / Custom Cursors using Classes AS2 Help

I’m trying to make a custom cursor in flash using as2. However the code can’t be frame code, because I’m using class files to make it. And also I prefer to use class files as it’s easier to debug.
Here’s some of the code that I’ve tried.

class Cursor extends MovieClip
{
 function onEnterFrame()
 {
     _root.cursor._x = _xmouse;
     _root.cursor._y = _ymouse;
 }
}

And yes I did try changing the instance name “cursor” to a different name.
Thanks

 
Flag Post

Topic: Game Programming / Help finding good tutorials to learn AS3

I can’t find a good tutorial that explains the code. All the tutorials I find are simple copy and paste into your file.

Could someone point me towards a good tutorial for AS3?
Also, where did you learn how to program AS3?

 
Flag Post

Topic: Game Programming / Frame Code with Scripts?? AS2

Here’s the preloader I used:
<http://www.flashvalley.com/fv_tutorials/creating_a_preloader_in_Flash/&gt;

I tested the preloader in my scoutship game. I didn’t post it. but when I tried it, the frame code took precident over my external scripts. The scoutship game is based on kongregate’s shootorials. I just moved all the game frames over to frame 2. And put the preloader into a single layer code and all.

Edit: I didn’t post the “preloader test scoutship” just the “Original Scoutship”