Posts tagged as ' Programming ' ...

Posted By Tommy

hitTest fails to work with a line!!!

So I’ve been trying to get my space alien game working, and ran into a huge block. No matter what I did, I couldn’t get Flash to recognize my lines with the hitTest function!

I couldn’t figure it out. I had two movieclips, and I was trying to use the hitTest function. What’s so hard about that???

You can test for yourself. First make a line on the stage, then make it into a movieclip with F8. Call it something original like “lineOnStage”. Now try as you can, you will never be able to get the hitTest to fire!!! Oh boy. Guess they forgot to mention that the hitTest function works with the fill, not the border.

createEmptyMovieClip("triangle_mc", getNextHighestDepth());
triangle_mc.beginFill(0x006090);
triangle_mc.moveTo(50, 50);
triangle_mc.lineTo(100, 150);
triangle_mc.lineTo(0, 150);
triangle_mc.lineTo(50, 50);

var hit_X = 100;
var hit_Y = 75;
var shapeFlag = true;

triangle_mc.onPress = function() {
this.startDrag();
};

triangle_mc.onRelease = function() {
this.stopDrag();
if (this.hitTest(lineOnStage)) {
trace("Hit.");
}
};

Ok, one more secret:

If you reduce the width of a rectangle to 1, you can never increase it again. It is now a line. Haha. So you have to delete it and start from scratch.

Posted By Tommy

Daily Builds Are Your Friend

Daily Builds Are Your Friend

This is a fun though old (2001) article about “daily builds”. It means that you should have a stable system that you’re working on… Unfortunately, my system was working last week, with lots of kids testing it. There wasn’t really a bug, but the data reporting was subpar, so I decided it was the right time to.

I assumed it would only take a couple hours to update, but silly me, it took a bit longer for each step. I updated the build and the drill sections. Finally I’m updating the play section, which seems to be working except that right now the text boxes aren’t showing up on the screen. I know it’s working because I can hear the voice speaking out the word, but I can’t see the boxes. Well, I have barely delved into what’s going wrong, so I assume it can be fixed quickly and easily..

Posted By Tommy

Surefire ways to motivate team members

Sure-fire Ways To Motivate Your Team Members – Project Shrink.

Not sure why, but recently I’ve been reading about project management. So here’s an interesting article about how you can motivate your project. For example, you should point out important milestones, you shoudn’t blame people, and you should give positive feedback.

FPGA%20USB%202.0%20Hardware%20Modules%20for%20Rapid%20Development%20and%20OEM%20Integration%20%7C%20Opal%20Kelly.

Nowadays, Moore’s Law means not only are our computers more powerful, but also that it’s easier and cheaper for consumers to get DIY electronics products that are really powerful. Following in the path of Arduino, you can check out FPGA USB 2.0 hardware modules, which allow you to do your own designing of hardware. And you can program them in languages like C and Python, which means that assembly code is not needed!

It’s obvious that this trend will continue. One day, we may all be able to have any electronics products we like easily made–by ourselves if we so desire. But will schools be teaching the kinds of skills needed for learning about this kind of engineering? Or will we be reliant on low-paid workers to make our products for us? Is it worth building our electronics ourselves, when we can easily go to the store and buy an iPhone instead?

Posted By Tommy

DevMaster.net – Object-Oriented Game Design

DevMaster.net – Object-Oriented Game Design.

B. L. Hannah’s article about Object-Oriented Game Design is nice because it’s readable. It makes a good argument for object oriented design in games. Generally, game books don’t focus on OOP, perhaps because games are more easily considered in terms of architecture. But this article is great because it gives a clear breakdown of what a game is in 5 basic parts:

  1. Game Entity – Any “things” in the game, such as avatars, obstacles, or enemies.
  2. Game Action – A model that represents any actions that entities invoke. Actions may affect other entities. This model represents the game mechanics.
  3. Game Form – The appearance of the entities when the game is running.
  4. Game State – Data that keeps track of the entities or their forms.
  5. Game Space – The collection of the different objects in the game. It also includes sorting, which may be done to optimize the game.

Using only these five components, basically any computer game can be implemented. Though each componoent has little to do by itself, in conjunction with the others, the relationships form the heart of the system.

From these humble beginnings, the author goes on to outline how each of the levels can be conceptualized.