overidon.com Central Database for Overidon Omnimedia

November 25, 2012

Guessing Matrix 2012

Filed under: Free Games,Programming — Tyler @ 11:13 am

Get Adobe Flash player

 

Thanks for playing our latest game! If you would like to read the code for Guessing Matrix 2012 go ahead and click HERE.

As you can see, the AI doesn’t do the best job with repeat numbers. That’s because this program was made without using arrays. (recursion only) You should check out the code for yourself to see how it’s done.

Also, you’ll notice that the “trace” methods were turned to comment code for the final product. Remember to take out the “//”  from the code in your actionscript file if you want to see how tracing can help debug a program.

-Tyler

*SHARE*

October 21, 2012

Make the Turnip turn up

Filed under: Programming — Tyler @ 2:10 am

This article is part of a new series on computer programming. Tyler will be sharing select experiences with programming along with the actual code which is used in solving the problem. The purpose is to allow others on the internet to learn programming along with Tyler and other contributors.

TURNIP PROGRAM:

In this Flash Program, you have the ability to move the box. Once you move the box to cover the turnip, you can attempt to make the turnip disappear.

Did your magic trick work? Was the turnip completely gone by the time you moved the box away?

OK! So several things are happening in this little Flash – Actionscript 3.0 exercise.

Although this program isn’t an actual “game” or anything of true entertainment value, it does illustrate 2 important programming issues:

1. The difference between “Alpha” or “Transparency” shifts and how both Boolean values used in conjunction with “if” statements can solve problems.

2. Simple “x” or “horizontal” movement of objects can create illusions in which the programmer can control.

Get Adobe Flash player

 

In this article, we will have small snippets of code in another font type. But if you want to read the entire source code for this project, you are free to do so by clicking HERE. (please read the Terms of Service when using source code and reading these more technical articles. Thank you.)

Trying to get the turnip to turn invisible after a few clicks of the mouse didn’t work at first. It would get very translucent, but the turnip would never actually disappear. In terms of this magic trick, a partially disappeared turnip doesn’t have the full effect for our audiences.

The original code looked somewhat like this:

bg.turnip.alpha -= .1;

The problem with this code is that it never gets the turnip…completely gone! So when it decides to turn up, it actually has no intense effect on the viewer when the box is moved for the big reveal.

So the code was changed to this:

bg.turnip.alpha -= .1;
if (bg.turnip.alpha <= .2) {
bg.turnip.visible = !bg.turnip.visible;
}

This above code actually works. When the user clicks the “ATTEMPT TURNIP DISAPPEAR SPELL” several times they are actually reducing the “alpha” levels by .1 over and over again.

Then when the alpha levels get low enough, the “If” statement checks to see if the levels are “less than” .2 this used in conjunction with the “!” before the visible call creates a Boolean true/false statement.

So in English this code is really saying:

After each click of the “ATTEMPT TURNIP DISAPPEAR SPELL” button, please reduce the alpha or transparency levels of the turnip which is nested in the “bg” or background movie clip.

If the alpha levels are “lower or equal to” 20% of the total opaqueness of the turnip… then please make the turnip change from it’s current visibility designation, to the opposite of its current visibility designation.

As you can see, being able to mentally translate the computer code into English language is an important thing to keep in your hat. It doesn’t require any special skills either. All you have to do is say out loud what you’re trying to do and have some scratch paper by your desk for jotting down notes. If you have occasional notes and are willing to take short breaks, working through the debugging process is not very frustrating at all.

Also, here’s a tip:

When setting up your actionscript class codes, make sure to link the empty stage to your “Main” class. That was the most frustrating aspect of transitioning from my JavaScript training at Codecademy to my current training on Actionscript. When at Codecademy, you’re only using a temporary console. This isn’t an independent system such as a flash SWF file, so there’s nothing to actually “link” to when making projects.

Now if I see a blank SWF file, double checking the linkage between the document empty stage and the “Main” class in the properties section is the first thing I do.

I hope you enjoyed this article, and if you have any questions or comments feel free to leave one. Or if you prefer to talk via Facebook you can visit our page by clicking HERE.

-Tyler

March 21, 2012

Codecademy Gets an Upgrade

Filed under: Programming — Tyler @ 12:51 pm
Codecademy

Codecademy has upgraded and streamlined its Javascript Programming Tutorial Resources

The fantastic free programming resource on the internet known as, “Codecademy.com” has thoroughly upgraded its tutorial and achievement tracking environment. I’ve been learning how to program Javascript since Codecademy launched a few months ago. As of yesterday, there have been several bugfixes and software upgrades which make the environment much more conducive for thorough learning of computer programming.

A major bugfix that really made my day was the implementation of smart profile pic changing. I was having trouble changing my profile picture last week and I sent an email to them. It looks like they fixed the profile pic issue and you can upload any major file format picture to adjust your pic. I’m using a pizza cat picture that a friend of mine made. I hope she doesn’t mind…it’s just that those cats really get me in the mood to learn about Boolean true and false statements.

Another awesome bugfix was the “100% Complete” issue. For some reason, if you hadn’t started a lesson or programming project, it would say you had it 100% Complete, which was not true. Now the correct percentages of your progress will show up when you explore your “Learn” coursework tab. Right now I’m 92% done with learning about functions in Javascript and so it’s fun to track the progress.

Aside from Bugfixes, there has been several upgrades to Codecademy over the last day or so. The first addition is an extremely concise and easy-to-navigate programming glossary. Even if you are an expert Javascript programmer, you should bookmark the glossary by clicking HERE. Similar to the rest of the Codecademy website, the glossary is completely free and you can quickly check on operator functions and other terminology in a consolidated resource.

To make things even more awesome, Codecademy has streamlined the process for users to create their own interactive lessons and tutorials for the greater Codecademy community. So this means I was going through the functions lessons and then one day I noticed that I had more coursework to do. That’s because another user created additional lessons for us all to complete. It was so strange because I thought I had finished everything in that section already. That’s the beauty of a living and breathing coding environment. People can make the coursework more robust by adding exercises which stretch the comprehension of the students. It’s very exciting to see new lessons pop up every week or so.

As I said, Codecademy.com is completely free at this time for people to jump on board and learn how to do some Javascript programming, so check it out and hopefully you can break through any barriers and make some fun programs!

-Tyler

« Newer Posts

Powered by WordPress