235 Slices
Medium 9781449360504

5. Debugging and Optimization

Jesse Freeman O'Reilly Media ePub

One of the most rewarding parts about building HTML5 games for Windows 8 is the fact that, if your game is already running in the browser on the desktop, chances are good that it will run perfectly as a Windows Store app. Of course, in the real world, nothing works exactly like you expect it to. This chapter will go over some of the best ways to optimize your game so that it runs well on your computer and all the other Windows 8 devices out there.

If you are a fan of console.log(), you’ll be happy to know that all of your log traces will still show up in Visual Studio’s console window. This means the quickest way to debug your app is probably to throw a console.log() statement in there and see what’s happening. There are a few things that Visual Studio doesn’t support in the console output, which you may be used to in a browser log window:

Visual Studio will not output the structure of an object. This means you simply get a string equivalent of the object. For exploring objects, you will need to use the debugger and a breakpoint, which we will talk about next.

See All Chapters
Medium 9780892728060

Are you familiar with this western Maine community?

Andrew Vietze Down East Books ePub

Perhaps we should really be asking “Where in New Hampshire?” Motorists driving through this western corner of Maine are often unsure which state they’re in. This church is indeed in the Pine Tree State — but just barely. It sits about a mile from the border in a very quiet section of town on a road that slides in and out of the Granite State on its way north. The real question, though, is where is the rest of the village and, why is this sweet, white Unitarian church by itself on a corner with nothing else around but a cornfield? Meetinghouses, as all who have been to New England know, are usually at the very heart of a community. Someone who might have known why this church was built here was Admiral Robert Peary, famed explorer of the Arctic. He was once a surveyor in town. Orator and politician Daniel Webster could have had an explanation, too, or at least would have convinced you that he did — he once wrote deeds here to supplement the income he made as a teacher at the local academy. Hopa-long Cassidy, legendary Western hero, is another proud son of the town, created by resident Clarence Mulford in the early part of the twentieth century. And art great Eastman Johnson once painted landscapes here. But on this pretty late summer day no one seems to be around to ask. It just might be that everyone has gone for a paddle down the state’s most popular canoeing river, which is nearby. Or they could all be at home getting their prize produce together for the local fair — the state’s largest county fair turns this picturesque riverside town into a big carnival at the beginning of October each year. See page 100.

See All Chapters
Medium 9780596100599

1. Halo 2 Jumping

Stephen Cawood O'Reilly Media ePub

Much like Halo fan videos (see http://www.redvsblue.com), Halo 2 jumping has taken on a life of its own. Groups such as Jump Tactics (http://www.jumptactics.net) have raised the bar when it comes to the difficulty and complexity of Halo 2 jumping techniques.

Some sites have even started to have "jump" game tournaments. Instead of fighting each other, players engage in a game similar to HORSE. One player challenges another to perform a particular jump. If a player fails to meet the challenge, a referee penalizes him with a letter. Some of the more esoteric jumping techniques are not applicable to normal Halo 2 game play. However, other jumping techniques are vital for all players to learn.

Many of these trick jumps require considerable practice, so I met up with Kahai Maluu, the founder of Jump Tactics, on Xbox Live. Kahai demonstrated some of the more difficult jumping maneuvers. In fact, we captured some screenshots for this chapter during that online session.

Unfortunately, we don't have space to include all of the jumping techniques here, so look online for information about other jump techniques (http://www.jumptactics.net/modules.php?name=Downloads). I recommend that you check out the online videos of each technique.

See All Chapters
Medium 9780596009465


Joshua Paul O'Reilly Media PDF

Chapter 3 C H A P T E R



Hacks 26–38

Every aspect of creating a video revolves around the footage, so acquiring it is quite obviously the most important element. Without footage, you can’t edit or distribute a video. The decisions you have to make determine what you want to acquire and how you should do so. The hacks in this chapter will help you collect footage from various sources, shoot footage in unusual ways, and help you bring all of your footage (no matter where it originates) together.



Create a Time-Lapse Video of a Sunset

Hack #26

Compressing a long event into a few seconds can create a wonderful transition.

You have probably seen a time-lapse video in educational movies, such as the ones that show a rose as it progresses from a bud, to full bloom, to its leaves falling off. This type of imagery can be quite powerful. Unlike film cameras, most digital video cameras do not allow you to change the frame rate at which they capture.

Although the technique somewhat limited, this hack should provide an effect similar to what you can accomplish with a film camera, at a fraction of the cost.

See All Chapters
Medium 9781449360504

4. Handling Game Controls On Windows 8

Jesse Freeman O'Reilly Media ePub

When it comes to game controls for Windows 8, things can get a little overwhelming if you don’t have a plan in place when porting your game. If you remember back to Chapter 1 where we reviewed the different Windows 8 device form factors, you may recall the diversity of Windows 8-capable hardware. With that in mind, the following input options could be available at any time to control your game:





Game Controller


Luckily, if you are coming over with an existing HTML5 game, chances are good that you are already using keyboard or mouse controls. In special cases, if your game was designed to run on mobile multi-touch, you may be ready for multi-touch on Windows 8 with a few minor modifications to your code.

The good news is that, if your game only uses the mouse, as in a single-input method, chances are good that you may not have to change a thing. We’ll get into this more when I discuss touch-first design. If you are using a keyboard, you may need to offer up additional controls on touchscreen devices. Usually, this is done with a virtual D-pad and buttons or a virtual controller stick.

See All Chapters

See All Slices