Recent posts by FlashGrenade on Kongregate

Flag Post

Topic: Game Programming / questions about moving objects with delta time.

okay i didnt know youd get 0 the 2nd time. So I stored getDeltaTime in a var called temporal, and now it works. the balls can move vertical and horizontal and diagonal.
thanks.

 
Flag Post

Topic: Game Programming / questions about moving objects with delta time.

Okay heres what I got

package
{
	import flash.display.*;
	import flash.events.*;
	import flash.utils.getTimer;
	
	public class AnimatedObject extends MovieClip
	{
		public var speedX, speedY, speedR:Number; // current speed, pixels per second
		public var _root:GameEngine;
		public var R:IDCode;
		public var itWraps:Boolean;
		public var itBounces:Boolean;
		public var isKilled:Boolean;
		public var tankMovement:Boolean;
		public var lastTime:Number = 0;
		public function AnimatedObject(ge:GameEngine, _x:int, _y:int)
		{
			this._root = ge;
			this.x = _x;
			this.y = _y;
			this.isKilled = false;
			this.addListeners();
		}
		
		public function checkBoundary():void
		{
			trace("blank");
			if (this.itBounces)
			{
				if (this.x < 25)
				{
					this.x = 25;
					this.speedX *= -1;
				}
				if (this.x > 615)
				{
					this.x = 615;
					this.speedX *= -1;
				}
				if (this.y < 25)
				{
					this.y = 25;
					this.speedY *= -1;
				}
				if (this.y > 455)
				{
					this.y = 455;
					this.speedY *= -1;
				}
			}
			if (this.itWraps)
			{
				if (this.x < -25)
				{
					this.x = 665;
					
				}
				if (this.x > 665)
				{
					this.x = -25;
					
				}
				if (this.y < -25)
				{
					this.y = 495;
					
				}
				if (this.y > 495)
				{
					this.y = -25;
					
				}
			}
		}
		
		public function onClick(event:MouseEvent):void
		{
			trace("enemy clickd");
		}
		
		public function setNewAngle(nAngle:int):void
		{
			this.tankMovement = true;
			this.rotation = nAngle;
		}
		
		public function setNewXSpeed(nX:int):void
		{
			this.speedX = nX;
			trace("speedX is:"+this.speedX);
		}
		
		public function setNewYSpeed(nY:int):void
		{
			this.speedY = nY;
			trace("speedY is:"+this.speedY);
		}
		
		public function setRotationSpeed(nR:int):void
		{
			this.tankMovement = true;
			this.speedR = nR;
		}
		
		public function addListeners():void
		{
			trace("begin adding listeners");
			//this.addEventListener(Event.ENTER_FRAME, entrfrm);
		}
		
		public function removeListeners():void
		{
			trace("begin removing listeners");
			//this.removeEventListener(Event.ENTER_FRAME, entrfrm);
		}
		
		public function getDeltaTime():Number
		{
			var timePassed:int = getTimer() - lastTime;
			lastTime += timePassed;
			return timePassed;
		}
		
		public function updateLocation():void
		{
			trace(" moving object");
	
		}
		
		public function contactCheck():void
		{
			trace("begin contact check");
		}
		
		public function kill():void
		{
			if (_root.gameObjects.contains(this))
			{
				this.removeEventListener(MouseEvent.CLICK, onClick);
				_root.gameObjects.removeChild(this);
				this.isKilled = true;
			}
		}
	}
}
then i created my ball to extend the animatedobject

package
{
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.utils.*;
	import flash.geom.Point;
	
	public class Ball extends AnimatedObject
	{
		

		
		public function Ball(ge:GameEngine, _x:int, _y:int)
		{
			super(ge, _x, _y);
			this.addListeners();
		}
		override public function addListeners():void 
		{
			super.addListeners();
			this.addEventListener(MouseEvent.CLICK, onClick);
			this.addEventListener(Event.ENTER_FRAME, entrfrm);
			
		}
		override public function removeListeners():void 
		{
			super.removeListeners();
			this.removeEventListener(MouseEvent.CLICK, onClick);
			this.removeEventListener(Event.ENTER_FRAME, entrfrm);
		}
		
				public function entrfrm(e:Event):void {
		this.updateLocation();
		this.contactCheck();
		this.checkBoundary();
		}
		
		override public function updateLocation():void
		{
			super.updateLocation();
			trace(" moving ball");
			this.x += speedX * getDeltaTime() / 1000;
			
			this.y += speedY * getDeltaTime()  / 1000;
		}

		override public function contactCheck():void
		{
			super.contactCheck();
			//if this
		}
		
		override public function onClick(event:MouseEvent):void 
		{
			super.onClick(event);
			this.kill();
		}
		override public function kill():void
		{
			this.removeListeners();
			super.kill();
		}
	
	}
}

im running it and the balls move, and can wrapacross the stage or bounce back but they all move to the right. even though they should not.

am i missing something here?

 
Flag Post

Topic: Game Programming / questions about moving objects with delta time.

So Im trying to get some objects to move on stage using the standard formula for getting time based movement but im running into some problems getting it to work correctly.

How would other programmers pull this off?

how would you calculate time based movement?

Would you calculate deltatime in the class of a moving object or would you put in your main engine?

If objects controlled by the player and the cpu are superclasses of an animated object, how would movement be regulated?

 
Flag Post

Topic: Game Programming / Happy Programmers Day!

trace(“NO CAKE?”);

 
Flag Post

Topic: Game Programming / 2 Royalty Free Video Game Music Libraries

Ill give it a download.

 
Flag Post

Topic: Game Programming / The future of flash

you can still make a good game in flash and as3, you just need to make sure you can be able to port it out to multiple platforms. Developing games just for the flash platform alone is and will no longer be a viable way to generate revenue.

 
Flag Post

Topic: Game Programming / GameMaker Problems

Originally posted by CaptMilkshake:
Originally posted by saybox:
Originally posted by CaptMilkshake:

So a long time ago I made a cool little shooter game with game maker but, once it was done i couldn’t upload it to kong because f the file it was saved as something other than SWF. Is there ANYWAY at all that i can save it as an SWF or even upload it to another site and post it as an iFrame code? Would the iframe thing work. That seams like a lot of hastle just to get it onto kong.

Thanks in advance.

It’s possible but you need the version of GameMaker that costs 60 bucks. Then you can export to HTML5, which Kong supports.

Dumb…. it isnt really worth it i would rather spend that 60$ on RPG Maker

Even if you did pay for rpg maker you’d be in the same boat: RPG maker only makes games designed for windows. Those that used this product still had to convert the code in order to port it to ipad or android.

 
Flag Post

Topic: Game Programming / [Special Event] Kongregate Live! Join us for our first event, featuring jmtb02--Today!

Will you guys be be posting the results afterwards? If I cant make it I would like to see how it goes down.

 
Flag Post

Topic: Game Programming / Flash->Consoles, who's interested?

Trust me if I had one game under my belt I would apply to something like this.
I’ve taken your post to heart and I’m starting to take a look into HaXe.
But unless I can get some HaXers to proof my code and weigh in their opinion, I may have to go back to as3.

 
Flag Post

Topic: Game Programming / What was that game engine called?

RPG maker ONLY IF you know how to convert code. Games made from RPG maker only port over to windows. Still its an option

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

Anyone wanna sign up for this?

Can someone sticky this so it doesn’t disappear?

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

Originally posted by qwerber:

Curiously, what do people use Haxe for? Other than a slightly improved AS3?

Because of the fact its open source and a software company doesn’t have its fingerprints all over it, programs in Haxe can be ported over to android and ios and linux. As3 can not. Steve jobs hated it, and wouldn’t let it on his products. It can still be used to make good games, but the target medium it was designed for is slowly becoming irrevelent. I see more solid games like tyrant and freeway solitaire become available on the ipad and android.

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

I’m trying to recreate my ecs pattern to haxe anyway. You want to compare notes for this then by all means. But I think we should stick to Inheritance first and then mod it with ecs. That way we should be able to show the difference between Inheritance and Composition based programming. Its not difficult at all to perform the former first; the nuke class is ridiculously short that I just finished flipping it to haxe before typing out the rest of this sentence.

In any case a deep analysis of the existing file is needed first to identify and fix the flaws.

anyone want to sign up for this?

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

The title pretty much says it all. The Shootorials are in both as2 and as3. I propose we all band together and take it to the next level and compile it in Haxe.
It would serve the following purposes.

1) It will give guys here a chance to learn HaXe.
2) the as3 version according to some ppl on this forum has some developmental errors. By redoing the code in haxe we can identify and fix these errors for the as3 model
3)the game itself can be modified and updated.

 
Flag Post

Topic: Game Programming / Creating a side scrolling platformgame in As3

Its much better to code in as3. as2 is a history lesson now.

 
Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Okay now you are being snide for the sake of being snide. “Just google it.” like I’m incapable of doing that or haven’t already done that already before posting this. Or checked to see if there are youtube videos related to what I need to know for haxe.
Or went on irc to pose questions.

You are not doing anyone any favors with your “Just test it, just google it.” attitude, least of all yourself.

 
Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Can’t you just test it? I’m not sure what the issue is.

No. One cannot simply ‘just test it’ if they have no idea what they are trying to type. It’s bad enough that I need my as3 code looked at with a fresh pair of eyes, now I have to convert what I have (which may be flawed to begin with) and try to get answers from less support. The forums and irc you mentioned are lost woods to me.

This is the boat I’m in and this will be the same boat other would be haxe programmers will find themselves in, unless better support can be found.

And don’t get me started on that command line crap. If I wanted to type in commands old school, I would hop in the delorian, drive all the way back to 85 and grab my old Tandy 1000.

 
Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Okay I’ve just started to code in Haxe now. It’s really not too bad seeing that I studied AS3 before this. Making the changes
to my code is not the issue. However making sure that my newly types haxe code is correct is going to be an issue for myself and for other programmers who wish to follow suit.

Is there anywhere we can go for guidance on this matter? Forums, blogs? Chat rooms? Should we put something like that here?

 
Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Is there a way to get this in a pdf file please? It would be nice to be able to read this offline.

But make no mistake; there is no ‘if’ about it. Flash is heading toward becoming the new BETA.
When I started this I believed otherwise, but the future is now and it has proven me wrong.

That does not mean the tools we use to make flash games are obsolete or useless, it just means
that we all have to adapt to this serious change and press on. This might just save my ass in the long run.
Thank you so much.

 
Flag Post

Topic: Game Programming / Loading Multiple JSON objects.

Thanks. You can close this now.

 
Flag Post

Topic: Game Programming / Loading Multiple JSON objects.

I’m pretty sure I know the answer is yes, but Ill ask anyway to be 100% certain.

Can you read from multiple json files and store the data into different objects?

What I’d like to do is read from different types of data files like music and sound
or player and enemy statistics based on difficulty. Then store them into a audio jsonobject, and playerstats object, or an animation object.

 
Flag Post

Topic: Collaborations / Programmer open for project

Beautiful. You’re hired.
I got this project I’m working on for 3 years now. Long story short I’m trying to recreate the Final Fight engine, to be used in a myriad of games.
Details are here.
http://www.kongregate.com/forums/8-collaborations/topics/385948-need-collaborators-for-completing-a-fighting-engine.
My source code is on dropbox.

 
Flag Post

Topic: Game Programming / Mochi Shutting Down

Exactly. Use whatever you feel comfortable in making your games. I know ppl who use Game maker for development.

 
Flag Post

Topic: Game Programming / Mochi Shutting Down

I havent published any games yet so this really has not affected me very much if at all.

Don’t look at this as a sign that Flash is no longer a viable means to create solid games.
True Flash is no longer supported as a must have in web and mobile development,
which is probably one of the reasons that MochiAds is now shut down. But you can still
make a killer game in as3, port it out to the mobile devices and get your ad revenue from there.

 
Flag Post

Topic: Collaborations / Need collaborators for completing a fighting engine.

Hi. Ive been trying to develop a project similar to OpenBOR for the past 3 years.
Recently I’ve been introduced to composition based programming with the help of a few posters on the web and I have started to lay out the blueprints for a open source engine called “EntityFIGHT”. Notes are right here.

https://www.dropbox.com/s/crvh0z9j7eokoun/EntityFight.pdf

Unfortunately EntityFIGHT has been an 1 man project for a very long time and that situation desperately needs to change. Aside from asking for assistance in completing this project, what I personally need is experience coders who can first and foremost proofread my notes and my source code, so I can be certain I’m not coding my house on top of sand.

I’ll be editing this post at a later date to include my source code.

I will be most grateful for any help on this project. Feel free to reply here or contact me by pm or email.