jQuery Plugin: gwSlideshow launched

A while ago, I wrote a jQuery based slideshow that I shared with some friends, and I ended up getting a pretty good response to it – enough to merit making a full plugin with it. Here is the initial launch of the plugin and project, and I’d love to get any feedback pertaining to usability and additional features.

The intent is to remain very lightweight but flexible, and so far, that seems to be met. Following, you will find links to my Google Code project page as well as a sample script that demos the working slideshow. For any additional questions, please feel free to contact me.

Google Code: http://code.google.com/p/gw-slideshow/
Demo: http://code.guahanweb.com/jquery/demos/gwSlideshow.html

Enjoy!

WhatGamersWant.com

In efforts to create a unique gaming site, we would like to get your input on what areas of the gaming community have yet to be tapped to their fullest potential. If you have any input at all concerning what focus this site should take, please leave feedback on the site directly: www.whatgamerswant.com. Thanks for helping out!

Not Just Another Gaming Site

So, I have come to a decision point, and I need some input. Having owned the domain www.whatgamerswant.com for nearly two years now, I figure it’s about time to do something with it, so I am faced with the challenge of deciding what, exactly, to do.

I have toyed with ideas for using it as a portal to Video Games, Board Games or both, but the last thing I want is to have it turn into just another gaming site floating around the web. Rather, I want it to become the embodiment of its name: a site which provides gamers with information that is both relevant and desired, whether that is a compilation of some of the most popular news feeds and blogs or a comprehensive list of game details for new releases and titles still in development.
Continue reading

Optional Config Objects in JavaScript OOP

Well, one of the challenges in writing our custom JavaScript library for this next release of our CMS at work has been to come up with a modularized approach to our objects that can be followed precisely while still allowing a measure of flexibility to the end developer (Imagine that! Actually trying to support some framework style design principles in JavaScript!). Anyway, what has been one of the most challenging pieces to the puzzle has been to appropriately handle configuration objects passed to constructors that override specific, default behavior of the object.

No, the challenge was not so much handling a config object proper — that is relatively easy. Where the challenge began to really take shape was in allowing a user to provide specific pieces of optional data and only use the valid pieces of the config object to override existing default values while ignoring the rest so as not to cause any JavaScript errors to be thrown elsewhere in the script. For a quick example, let’s say we have the following data object that loads itself up using an Ajax call (NOTE: all examples in this post are using the ExtJS lib).
Continue reading

The Importance of a First Impression in Web

We all have heard the saying that You never get a second chance to make a first impression, and just as much as in our personal relationships, the brutal force of this statement shows itself true in the web world as well. I cannot count the number of times I have visited a website to glean information about a particular topic only to be immediately bombarded with any number of issues: from broken links to JavaScript errors, layout issues due to lack of attention given to cross browser compatibility, and even, in some cases, the dreaded 404 error right from the home page. Now, none of these issues is a deal breaker to me; I mean, come on, we’re all human, right?

Well, what if that website happens to be for a company or product that is in a technology industry to some varying degree? Does that make a difference? Based on some feelers I’ve put out over the years both with clients and customers for many of the projects of which I have been part, this can indeed make all the difference in the world. Whether or not your organization or product is web related, the average user hints at the fact that, if your content is perceived to be technology based in any form, these small faux pas mentioned above take on an impact of much greater magnitude.
Continue reading

Google Analytics Style Graphing with AS3

Developers who have been using Google Analytics for any time can appreciate the flexibility and power behind some of the graphing software it offers. I recently found myself wondering just how they get the incredibly usable effect they have, so I began tinkering with some Actionscript and soon found myself with a very workable base that not only could be modified and grown to match what this software offers but is also surprisingly simplistic in nature.

Basically, we simply have our main application (or graph in this case) that can take any number of argument values and calculate not only their position based on ratio but also spreads them across the graph in a readable way. So, we create a simple point object that handles the visuals – both the expanding and contracting as well as the showing and hiding of the value text – and allow our graph to do some very simple calculations to spread them out evenly.
Continue reading

Harnassing the Power of Timers in AS3

Anyone who has had the experience of trying to time events for web via client side scripting before can readily appreciate the power and ease of using the robust Timer class in Actionscript 3. Similar to the idea of using JavaScript’s setTimout and/or setInterval methods, we can use this class to set a timer for a millisecond count that will simply trigger a TimerEvent when the timer has reached its end. The beauty of it, though, is that when the timer is created, we can explicitly declare how many times we want the timer to run! No more sloppy looping of intervals or timeouts: just set your timer to X number of loops and start it running.

So, obviously, if we create a timer to run once, it is the equivalent of running a setTimeout function. As with the aforementioned JavaScript functions, we set the timer with a number of milliseconds we want to wait before triggering its event. As an optional second argument, we pass in the number of cycles we wish the timer to run. Also, since the timer is an object, even if we set the timer to run only once, we can call the start method on it and manually run that single timer multiple times throughout our script. With a little creative thinking, I’m sure you can already come up with dozens of ways this could be useful.
Continue reading

Optimizing Code Reusability and Minimizing Your Footprint

One of the most common questions I am asked is also one of the biggest problems I see in code as I read it: lack of optimization. I often have people asking questions about how they can consolidate the generic actions they want multiple objects to have access to perform without duplicating the code. In Actionscript, just like any other coding language, the duplication of code is typically a red flag that you are doing something wrong. No, not wrong in the sense of broken, but wrong in the sense of best practice and code optimization. It is much easier to have one handler function to debug and keep up than to have that same handler individually executing in a dozen different class objects.

Quite possibly the single most useful thing I have discovered in optimizing some of the graphical effects I use over and over again is simply making use of the event object in my callback functions. When you attach an event listener to an object and the event is triggered, the event passed into the callback function has a target attribute that is a reference to the object which initially triggered the event. Accessing the object this way lets us generalize handlers (such as a fadeOut function) that will consolidate our code and give us uniformity in execution.
Continue reading

Consistent Omnidirectional Movement in AS3

One of my biggest gripes in Flash games to date is that of simulated motion that is by no means realistic. True, this may be acceptable for some games, but as a whole, there is something that just doesn’t feel right when your side scrolling shooter plane moves up one unit when you press UP, left one unit when you press LEFT but moves both up and left one entire unit when you have both keys depressed. Logically, by moving in two directions at once, your character or vehicle should not be granted an additional bonus to their movement speed. Not only does it offer unfair advantages to the competent player who learns to use this loophole to his advantage, but it also makes your control somewhat unwieldy. The human brain is able to estimate precise movements and predict where things should go, and some people, though they may not know the precise reasons, will gravitate to those games that their minds can accurately predict the outcome of a motion.

If you have read my last few posts, you understand that this more realistic motion has driven me to all sorts of physics and algorithmic studies in the past weeks. Today, though, I decided to write on something a bit more fun. Those of you who remember the great old days of R. C. Pro-Am, Super Off Road or other top view racing games can attest to both the challenge and creativity about learning to control a car driving in an omnidirectional world without having to sit directly behind the wheel.
Continue reading

Pendulums, Gravity and Angular Acceleration

Continuing my personal studies on simulating true gravitational acceleration in Actionscript, a couple days ago I arrived at one of the more conceptually challenging tasks I have tackled to date: the pendulum. I say conceptually challenging, because I tried to create a realistic pendulum in Flash a year or so ago and gave up after giving it a go. Now I realize that not only was my understanding of Actionscript limited then, but my realization of what true pendulum physics entails was also somewhat amiss.

As with any new task I set out to complete (especially those requiring a significant level of new knowledge on my part), I start with an array of Google searches — search terms like pendulum math, pendulum physics and actionscript pendulum tutorial to name a few. What intrigued me is that, while the results for such searches were incredibly numerous, very few of them actually tackled the topic of realistic pendulum movement. Instead, the majority of them (like this informative tutorial) create a facade to display a fairly believable pendulum motion by setting some random oscillation variables to the rotation of the movie clip. While this may suffice for the average SWF presentation, I wanted to find a much more realistic look that actually allows the pendulum object to react to forces acting upon it.
Continue reading