Recent posts by scotty123456789 on Kongregate

Flag Post

Topic: Game Programming / I want to make a game

Flash AS3 is kinda, well, dying. I recently just started working in Unity and I have to say, I like it. I know Java, and C# is pretty close syntax wise.

If you’re looking to create something with C++, I’d recommend Cocos2d-x. I’ve never used it before, but it is free and open source and I’ve heard good reviews about it.

 
Flag Post

Topic: Game Design / Programmer, Not A Designer. Need Input

Hi all, I’m a programmer and software developer with no artistic ability or knowledge what so ever!

With that out of the way, I saw the recent Game Maker Humble Bundle (https://www.humblebundle.com/) and thought the software could be useful. I’m mostly interested in Spriter Pro and Sprite Lamp for creating or designing sprites and 2d animations. Are they good software and is it worth buying for the price? Is anything else in the bundle a must buy?

Thanks.

 
Flag Post

Topic: Game Programming / [Q]Effective way to calculate velocity

Originally posted by player_03:

class Ball {
public var upgrades:Array<Upgrade>;

//…

public function update():Void {
var i:Int = upgrades.length – 1;
while(i >= 0) {
upgrades[i].framesLeft—;
if(upgrades[i].framesLeft <= 0) {
upgrades.splice(i, 1);
}

i—;
}
}

//…

public function get_ballSpeedY():Float {
var result:Float = ballSpeedY;
for(upgrade in upgrades) {
result = upgrade.adjustSpeed(result);
}
return result;
}
}

class Upgrade {
public var framesLeft:Int;

public function new(frames:Int):Void {
framesLeft = frames;
}

public function adjustSpeed(speed:Float):Float {
return speed;
}
}

class SpeedUp extends Upgrade {
public override function adjustSpeed(speed:Float):Float {
return speed * 1.25;
}
}

class SlowDown extends Upgrade {
public override function adjustSpeed(speed:Float):Float {
return speed * 0.8;
}
}

Similar functionality, still easy to extend, and… still overkill. But at least now you’re using an appropriate data structure!

Thank you both for helping. This looks simple enough for a 1 man team. I’m really only trying to get it to work the way I’m imagining, then update the code when necessary.

 
Flag Post

Topic: Game Programming / [Q]Effective way to calculate velocity

I’m creating a pong game and need a way to calculate the velocity of a ball moving in x and y. I have 3 different difficulties in which the ball will move faster by which difficulty you choose.

This is the base code for easy difficulty.

ball.ballSpeedX = -3;
ball.ballSpeedY = (Math.random() * 7) -3;

Medium is * 1.5, hard is * 2.

I have getters and setters for ballSpeedX,Y in the ball class.

I’m trying to implement breakout like upgrades in the game so that the ball speed will increase/decrease, but I’m not sure how to approach it. Any suggestions on how to implement upgrades or sample code that might help? If you’d like to see all the code to help, contact me and I’ll provide the source code.

 
Flag Post

Topic: Game Programming / Need Members for AS3 Game programming

Hi, studying computer information systems and I’ll be graduating in a couple weeks. PM me if you’d like help.

 
Flag Post

Topic: Game Programming / How to make a game...?

I’m a student in computer information systems and have been programming for 4-5 years now. PM me if you need any help on where to start or anything programming related and I can help you to the best of my knowledge.

 
Flag Post

Topic: Game Programming / [Q][AS3]Another game still running on New Game

Originally posted by Aesica:
When using removeChild to get rid of something for good, make sure every event listener (frame events, mouse events, etc) tied to it is also removed. Otherwise, they’ll continue to function, and even though it’s not on stage anymore and perhaps no other references to it remain anywhere, stuff is still going to happen.

That makes sense now, thanks for clearing it up for me.

 
Flag Post

Topic: Game Programming / [Q][AS3]Another game still running on New Game

Will removing the instances of objects once the game ends work? Example, removeChild(ball), removeChild(paddle) etc? I can’t just stop the entire game timer because everything runs off of it.

 
Flag Post

Topic: Game Programming / [Q][AS3]Another game still running on New Game

I’m making a pong style game, my problem is whenever a game ends, it has a button which goes back to the main menu. User clicks that, but the game is still running in the back. I found this out by putting some trace statements associated when the ball either hits the left or right side of the screen and the score kept changing after the user went back to the menu.

I understand AS3 for the most part, I just need a general solution to the problem.

removeChild(“objects”) or something?

 
Flag Post

Topic: Game Programming / [Q][AS3]Help with a wheel

Makes sense, got it pictured out in my head now.

Thanks!

 
Flag Post

Topic: Game Programming / [Q][AS3]Help with a wheel

I’m trying to make this wheel which will house different powerups once the player scores, but I’m not really sure how to approach it since I’m a horrible designer. It’s a pong/breakout style game.

How would I go about making a wheel that once the player scores, it spins to a random piece, changes a value in the game (such as add another ball), then continue on?

 
Flag Post

Topic: Game Programming / Trying to Become a Game Dev- Need Help

Agree, start with scratch just to learn the basic of programming. If you want to make games for Kong, ActionScript 3 is probably the best. It’s the first language I learned and it’s helped a lot with others.

Try out ‘The Programmers RPG’ here on Kong. Fun game that will teach you a lot about ActionScript 3, and it’s easy to follow.

 
Flag Post

Topic: Game Programming / [Q][AS3] Menu Screen Structuring

EDIT: Nevermind I found out the problem with this. SumGato pointed out I didn’t put addChild(mainMenu) to the goToMainMenu() function. This fixed it.

 
Flag Post

Topic: Game Programming / [Q][AS3] Menu Screen Structuring

This is my document class that handles menus and such: http://pastebin.com/52T3cgdD

If anyone has suggestions on how I can improve on this, please say so. This is my first game, so I guess I’m considered “novice”, however I do understand programming techniques.

The error occurs when attempting to go back to the main menu once you die in the game. A gameOver screen and mainmenu button appears. Once I click on my mainmenu button I get a null reference error. I debugged it to a line that didn’t have anything to do with it, being a function on my mainMenu class that made CPU’s play a game.

If you need to see other classes, let me know. Also let me know how I could improve upon the class and avoid future mistakes. Thanks.

 
Flag Post

Topic: Game Programming / [Q][AS3] Menu Screen Structuring

Bump. Still looking for help.

 
Flag Post

Topic: Game Programming / [Q][AS3] Menu Screen Structuring

I followed the Avoider Tutorial Method for making my menu system, but I’ve been running into weird error I’m trying to fix.

 
Flag Post

Topic: Game Programming / [Q][AS3] Menu Screen Structuring

I’ve been having a hard time trying to figure out how to structure a menu system. Basically, I only have the MainMenu, which starts different game modes, displays options, displays instructions etc. The game itself, then a PauseMenu and a GameOverMenu, which are both in-game activated menus.

I’d like to make the entire game in two frames, with a preloader in the first, everything else in the second (since I already have the menus and main game in one frame.)

Any tips, links to tutorials, or source codes which could help?

 
Flag Post

Topic: Game Programming / [AS3] Pause Function Problems

Added

 stage.focus = stage; 
So the stage always had focus. Fixed the problem.

 
Flag Post

Topic: Game Programming / [AS3] Pause Function Problems

Partially fixed. Gave the stage focus for each frame and changed to this..

 private function pauseGame()
		{
			stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
			function keyDownHandler(e:KeyboardEvent):void
			{
				if (isPaused == false)
				{
					isPaused = true;
					
					// If "P" Pressed
					if (e.keyCode == 80)
					{
						addChild(pauseMenu);
						pauseMenu.x = 275;
						pauseMenu.y = 200;
						stage.frameRate = 0.01;
					}
				}
				else if (isPaused == true)
				{
					isPaused = false;
				}
			}
		}

But I’m now having a problem where I’ll have my pauseMenu appear only if I move the mouse after I paused the game with “P”. The frameRate == 0.01 though and does pause.

 
Flag Post

Topic: Game Programming / [AS3] Pause Function Problems

I’m having problem with pausing the game. If I do not click inside Flash Player, the game with not pause. If I click inside of Flash Player it will pause with the KEY_DOWN, but if I try again I need to click inside Flash Player to pause. Seems like it’s losing the focus, but I’m not sure. Here’s everything in which involves my pause function…

 pauseGame(); "Called inside of my "tick" function which happens each frame." 
 private function pauseGame()
	{
		stage.addEventListener(KeyboardEvent.KEY_DOWN,
                keyDownHandler);

		function keyDownHandler(e:KeyboardEvent):void
		{
			if (stage.frameRate == 60)
			{
				// If "P" Pressed
				if (e.keyCode == 80)
				{
					addChild(pauseMenu);
					pauseMenu.x = 275;
					pauseMenu.y = 200;
					stage.frameRate = 0.01;
					isPaused = true;
				}
			}
			else if (stage.frameRate != 60)
			{
				if (e.keyCode == 80)
				{
					stage.frameRate = 60;
					isPaused = false;
				}
			}
		}
	} 
“Ignore not having the pauseMenu removed in else if”

Also do I need to call pauseGame() within my onTick function or just in the constructor?

 
Flag Post

Topic: Game Programming / [AS3] Text Format Registration Point

(Assuming it is somehow possible) how do you change the registration point of a Text Format’s Text either within or out of code? It’s set at the upper left hand corner currently and I would like to move it to center.

 
Flag Post

Topic: Game Programming / [AS3] Parameter not working

This worked. Thank you.

 
Flag Post

Topic: Game Programming / [AS3] Parameter not working

Here’s my Main class: http://pastebin.com/qiSsbAMj

As you can see I put in some trace statements to see what came back at the end of the constructor, which works like it should. I added a trace to the tick function and it came back as 0 every time.

Do i need something like?…

 this.gameMode = gameMode

 
Flag Post

Topic: Game Programming / [AS3] Parameter not working

NOTE: gameMode at the end of the constructor, but I put a trace statement at the beginning of my onTick which runs my game and gameMode always == 0, even if it’s 1 or 2 to begin with.

 
Flag Post

Topic: Game Programming / [AS3] Parameter not working

I’m trying to set up different game modes (easy, normal, hard). From the main menu the user selects either of these with one of three buttons. This is a pong style game.

In my main game class I declared

gameMode:int

In my constructor function is set the parameter as…
public function Main(gameMode:int)

On my document class which handles navigating between the screens, I set them to display with…
playScreen = new Main(0);
playScreen.x = 0;
playScreen.y = 0;
addChild( playScreen );

Within the constructor of the main class, I have if statements to tell what will happen in each gameMode…

if (gameMode == 0)
{
ballSpeedX = -3;
ballSpeedY = -2;
}

gameMode integers increase as difficulty increases. Example, gameMode 1 the ballSpeed is multiplied by 2.

Later on in my code when the player’s paddle scores, I have a function that resets the ball to the middle then send it off in x or -x direction. This is within the function for resetting the ball’s speed…

if (gameMode == 0)
{
ballSpeedX = 3;
ballSpeedY = Math.floor(Math.random() * 7) – 3;
}

…with different else if statements for each gameMode integer.

Once I get down to the resetball function, it only does gameMode == 0 and not gameMode == 1 or 2 even if those were selected.

What am I doing wrong? Am I making this to complicated? Anyway to make it simpler?