Lazy + Library Classes + One Piece

July 7, 2011

I went to visit my grandparents last week. I was lazy and didn’t feel like blogging. Then I got back and was still lazy. But now I’m slightly less lazy, so I’m going to blog.

So, before I left, I promised to share my library classes. Since it’s been 8 days since I blogged, I’ll share 8 of the classes I’ve made. Here they are:

Translator
Scaler
Fraction
BetterTimer
SaveDataManager
KeyManager
MouseManager
ArrowKeyMovement

I’d suggest that you package the classes as I have, since later classes will depend on some of these classes as they are packaged.

Finally, I’ve been watching a good amount of One Piece (probably some hundred episodes since my last blog entry). I highly recommend it (Thought not over Gintama). If you need some episode download/stream/torrent links, drop me an email (truefire87c@hotmail.com).

Cuz zoro is awesome.

Advertisements

Rotator

June 29, 2011

I’ve been working on a code library recently. Since I don’t have much to blog about, I figure I’d share a piece from the library every day (and maybe more often). Today, you get my handy DisplayObject rotator class.

package  libTF
{
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	public class Rotator 
	{
		
		public static function rotateAboutInternalPoint(obj:DisplayObject, pt:Point, amt:Number):void
		{
			var dist:Number = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
			var ang:Number = Math.atan2(pt.y, pt.x);
			pt.x = Math.cos(ang + obj.rotation * Math.PI / 180) * dist;
			pt.y = Math.sin(ang + obj.rotation * Math.PI / 180) * dist;
			rotateAboutRelativePoint(obj, pt, amt);
		}
		
		public static function rotateAboutRelativePoint(obj:DisplayObject, pt:Point, amt:Number):void
		{
			obj.rotation += amt;
			var dist:Number = Math.sqrt(pt.x * pt.x + pt.y * pt.y)
			var ang:Number = Math.atan2( pt.y, pt.x) * 180 / Math.PI + amt;
			obj.x += -Math.cos(ang * Math.PI / 180) * dist + pt.x;
			obj.y += -Math.sin(ang * Math.PI / 180) * dist + pt.y;
		}
		
		public static function rotateAboutCoordinatePoint(obj:DisplayObject, pt:Point, amt:Number):void
		{
			pt.x -= obj.x;
			pt.y -= obj.y;
			rotateAboutRelativePoint(obj, pt, amt);
		}
		
		public static function rotateTowardsAngle(obj:DisplayObject, ang:Number, rot:Number, limit:Boolean = true):void
		{
			var ang1:Number = obj.rotation % 360;
			if (ang1 < 0) {ang1 += 360; }
			
			ang %= 360;
			if (ang < 0) { ang += 360; }
			
			var da:Number = ang - ang1;
			
			if (Math.abs(da) < rot) { obj.rotation = ang; }
			else if (da > 180 || (da < 0 && da > -180)) { obj.rotation -= rot; }
			else if ((da > 0 && da <= 180) || da < -180) { obj.rotation += rot; }
		}
		
		public static function rotateTowardsInternalPoint(obj:DisplayObject, pt:Point, rot:Number, limit:Boolean = true):void
		{
			var dist:Number = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
			var ang:Number = Math.atan2(pt.y, pt.x);
			pt.x = Math.cos(ang + obj.rotation * Math.PI / 180) * dist;
			pt.y = Math.sin(ang + obj.rotation * Math.PI / 180) * dist;
			rotateTowardsRelativePoint(obj, pt, rot, limit);
		}
		
		public static function rotateTowardsRelativePoint(obj:DisplayObject, pt:Point, rot:Number, limit:Boolean = true):void
		{
			rotateTowardsAngle(obj, Math.atan2(pt.y, pt.x), rot, limit);
		}
		
		public static function rotateTowardsCoordinatePoint(obj:DisplayObject, pt:Point, rot:Number, limit:Boolean = true):void
		{
			rotateTowardsAngle(obj, Math.atan2(pt.y - obj.y, pt.x - obj.x), rot, limit);
		}
		
		public static function rotateTowardsMouse(obj:DisplayObject, rot:Number, limit:Boolean = true):void
		{
			if (obj.parent)
			{
				rotateTowardsAngle(obj, Math.atan2(obj.parent.mouseY - obj.y, obj.parent.mouseX - obj.x) * 180 / Math.PI, rot, limit);
			}
		}
	}

}

Nichijou!

June 26, 2011

Guess what… I’m blogging about an anime other than Gintama! That’s right! You can all pick your jaws up off the ground now. All three and a half of you who read this blog.

That anime is… *drumroll* Nichijou! (And you didn’t know that already from the title. Oh no you didn’t. You can’t fool me. You were totally surprised.)

“Nichijou” is a Japanese word that means… well, there’s debate on the “best” translation, but I prefer “Ordinary life”. Sounds pretty boring, right? NO YOU FOOL, WHAT ARE YOU THINKING?! The things that happen in Nichijou are anything but ordinary. Sometimes, a huge explosion may cause salmon to fall from the sky. You may see a boy riding a goat around the school, or someone’s arm may turn into a roll-cake. The strawberry on top of your cake may be replaced with a chess-piece, or maybe a student will pull a Dorayaki from his afro.

So yeah. It’s pretty crazy stuff. A lot of ordinary things happen too. Here’s an animated GIF from one of my favorite scenes, where the principal wrestles a deer:

WWE: PRINCIPAL VS DEER!


PSVita

June 26, 2011

So, details on the “NGP” (Next Generation Portable) that will be the successor to the PSP finally has some details out. It’s going to be called “Play Station Vita” or “PSV”. The reasoning has something to do with “rich gameplay and online social blah blah blah”, but come on Sony. NGP Sounded waaaaay better. Someone in the marketing department needs to be fired.

That said, it seem to have some pretty impressive technology in it. Full details are still unknown, but the GPU is said to be nearly as powerful as a PS3’s. The CPU has gotten an upgrade too. But they’re still ignoring the big problem. RAM. Handheld consoles need more RAM. They have CPUs and GPUs that can compete with my computer (a few years old), but the RAM on these can barely compete with my calculator. (An exaggeration. But the RAM on them is still worse than a lot of older computers). The Next Next Generation Portable better not continue the GPU craze. I want my RAM!

Also, no back compatability with the PSP :(. We need one of these:

Wii-Station-DS-360-Portable


Gummy Worms are Evil

June 26, 2011

I always eat like an entire bag then I’m all “Ooooh I hate these I’mma throw up”, and then I eat another bag. Evil. That is all.

EEEEEEEEEVIL! EVIL


The biggest blog post ever!

June 26, 2011

I haven’t made a blog post in… three whole days! So this one will be big and cover EVERY THING EVER (that is related to me, in the past 3 days, and important as well)

First, The “Kongregate Dare” (aka GiTD20). For the 20th Kongregate Game in Ten Days competition, it was decided that we would only get THREE days to work on an entry. Much like the 48-hour Ludum Dare game development competition, this has been termed the “Kong Dare”. There have already been some great entries. I don’t think I’ll enter unless I can pick up some epic motivation tomorrow, but it will be great nonetheless. And for GITD30, I shall be there! Check out the official thread here.

Secondly, I’ve been working on a much bigger freelancer project (it’s not huge, but it’s several times bigger than my previous one, which was tiny). I’ll ask if I can share details when it’s done. If so, you’ll hear about it soon. (I hopefully just turned in the final revision, though I may need to do one more)

Third: Lancer is going on vacation for the next half of a week. Who will I spam anime links to? Who will I get to test all of my crazy programs? Who will feed me when I’m hu… wait, that’s not Lancer. WHO WILL CONSTANTLY ANNOY ME WITH TALK OF WEBCOMICS AND “RED VS BLUE” AND CHEEZY AMERICAN SHOWS!?!?? HOW WILL I LIVE… I think I can make it 😛

Fourth: A friend of mine broke his external hard drive today. The same thing happened to mine not long ago. His, he dropped a few feet onto the carpet, mine just fell over when I bumped it. These things need to be a lot more solid. Seriously. My drive feels like I could snap it in half with one hand. I think they make them easily break on purpose, because there’s no other reason to have such a flimsy and loose casing on a $100+ piece of hardware. And what about data recovery? They should at least cover that in the warranty. “Oh, yay, I get my $100 drive replaced for free, but I have to spend $1400 to get my data back!”

Fifth: Remember that anime I blogged about, Gintama? If not, look back just a few posts. Well, it’s gotten even MORE awesome. I know I say this every episode, but it really has. Exponentially even. The only thing I can imagine that would be more epic than this last episode is the next episode (Which I will watch in two days). This one had some particularly awesome plot twists and character development. As well as dialogue… Oh yes… the dialoge…

[I had a little piece of epic dialogue here, but plain text just didn’t do it justice]

Gin and Jirocho


(Dis?)Honorable Mention

June 23, 2011

3:46 [Bryan127] truefire, i just read your entire blog and I had one problem with it
3:46 [Bryan127] You didn’t mention me anywhere
3:47 [Bryan127] and also, I didnt read any of it yet, but I’m still certain you didn’t mention me in it. So you suck.

Obviously I do not suck. Oh no. In fact…
I am awesome.