Debugging a BB10 WebWorks app: Cocos2d-x HTML5
In a previous article I explained the steps necessary to build & Deploy a BlackBerry WebWorks Application. I'd like touch on how you can debug WebWorks when things don't work the way you expect. Over the last few weeks I've spent a few hours here and there preparing a JavaScript version of a game of mine (Pocket Bombs) so it could be ready at BB10's launch.
I found that I had issues when running the app on my Dev Alpha test device, and that's where things got a little trickly...
Package and Deploy a BB10 WebWorks Application
RIM has greatly improved their WebWorks platform since the last time time I examined it. It's easier than ever to get an HTML5 application packaged, tested and deployed to a BB10 simulator or test device.
This article walks through the process to get your HTML5 app packaged and ready to debug on a BB 10 Test device. If you only have the simulator VM, just change your target for 'simulator' and everything will hopefully go your way.
Laptop Power Management Troubleshooting (Wakes from sleep)
While I'm really enjoying my Dell Precision M4700 Mobile workstation, it has the annoying behavior of waking from sleep at unexpected intervals. This happens at unpredictable intervals and at unexpected times like after hibernating the laptop or between 0 and 24 hours after placing the laptop in sleep mode.
I was able to get to the bottom of the problem today.
Errors Installing the Windows SDK: Please refer to Samples\Setup\HTML\ConfigDetails.htm document
While mining the Microsoft Website for any reference to CPUGrab.exe (See my Open Source Replacement CPUGrab.NET) I tried installing the Microsoft Windows 7 SDK. Seemed straightforward enough, until I ran into a string of errors which prevented me from performing a successful installation. Here are the errors I had to overcome to get the SDK to install correctly:
- C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\SFX\vcredist_x64.exe installation failed with return code 5100
- [SDKSetup:Error] Config_Products_Install: Windows SDK Setup (failed): Installation of the "Microsoft Windows SDK for Windows 7" product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information
- Product: Microsoft Visual C++ Compilers 2010 Standard - enu - x86 -- Installation failed.
- Windows Installer installed the product. Product Name: Microsoft Visual C++ Compilers 2010 Standard - enu - x86. Product Version: 10.0.30319. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 1603
This (brief) article explains how to install the Windows SDK and either avoid or solve these errors.
Cocos2d-x HTML5: Refactoring your code to simulate Thread.Sleep(milliSeconds) with setTimeout
I've been working on a JavaScript/HTML5 port of Pocket Bombs in my spare time. After getting most of the core code implemented I set my sights on the most visible feature of the game: the chained explosions that result from critical mass bombs. When implementing this feature on other platforms it has been easy to 'slow down' the chain reaction using something like C#'s Thread.Sleep(ms). Unfortunately in JavaScript there is no such thing as Thread.Sleep.
The 'solution' that is provided by JavaScript is the setTimeout(func, ms) function which will wait for a number of milliseconds then execute the function that is passed into it. Using setTimeout requires a bit of refactoring. In this article I explain what I needed to do to successfully implement a small delay in JavaScript for my Cocos2d-x HTML5 game.
SimCopter, Windows 7 x64: You'll need a Hypervisor and Windows 98
I recently stumbled across a game I used to play when I was a kid: SimCopter by Maxis. Since the game is so old I was not able to just 'install it' on my Windows 7 x64 system even using Compatibility Mode settings.
This article explains how to install SimCopter on Windows 7 x64 using a Virtual Machine. This approach may work for other old games like SimCity 2000 and Civilization 1.0. As the title would imply I highly recommend acquiring a copy of Windows 98 and the VMWare Player Hypervisor before continuing.
CPUGrab.NET
While trying to get Sim Copter working in a VM on my Windows 7 box, I found I had to use a tool called CPUGrab to keep the game from crashing very often. This tool used to be distributed with the Microsoft DirectShow SDK. Since that tool is no longer available from Microsoft I set out to create an open-source replacement version written in .NET.
Read on for details. Download link is at the BOTTOM of the page
Cocos2d-x HTML v2.1: How to migrate from v2.0
I've been getting to know cocos2d-x HTML5 edition for the last few weeks as I try to port one of my mobile applications to HTML5/JS (Pocket Bombs). So far I have had a positive experience with the HTML5 port of the framework (Barring the usual JavaScript annoyances, of course).
A new version of the framework was released a couple days ago (v2.1). This new edition does NOT preserve the same API as the previous version (v2.0). This article explains what I had to do to get my v2 project working with the v2.1 framework.
How to use a System Image to migrate to a new Drive (Windows 7 Backup)
I recently installed an Intel 520 series SSD in my Dell M4700 laptop. Since I did not want to have to reinstall Windows 7 and setup all my programs again, I decided to use the Backup feature built into Windows 7 Professional which lets you take a 'System Image'. My thinking is that I can save a lot of time and hassle by simply imaging my system as-is and restoring it on the new drive.
This sounds wonderful in theory, but in practice there are a few gotchas that can creep up along the way. This article will explain how to successfully migrate from an HD -> SSD using the 'System Image' feature of Windows Backup.
BlackBerry 10: Getting the Cocos2d-x Hello World app to build
This article explains how to get the sample 'Hello World' project building in Cocos2d-x. I had some difficulty getting it to compile and run. My goal is to eventually port my game Pocket Bombs from iPhone to BBX. As the iOS version is written in cocos2d for iPhone I hope to be able to quickly port it over once I figure out the BlackBerry port of the API.