DEVBUZZ Homepage Creating Pocket PC Games in eVB Using ASpriteCE
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | Starting Out

Creating Pocket PC Games in eVB Using ASpriteCE
Written by Andy Beaulieu  [author's bio]  [read 54316 times]
Edited by Derek

Download the code   Discuss this article   eVB Ver 3.0   

Page 1  Page 2  Page 3 

Let's face it: eVB has a bad rap when it comes to creating fast action games. eVC (and to some extent Assembly) have been the accepted languages for game development on the PocketPC. This is unfortunate, as the intuitive nature of eVB can make any type of application quick to develop and fun to create. The main reason for eVB being an unpopular choice for action games is its speed. Being that eVB is an interpreted language, it can be hundreds of times slower than eVC code at performing comparable operations. And to create that next best-selling Pocket PC game, you can bet fast graphics will be a prerequisite for your tool of choice.

But what if the speed of eVC could be combined with the ease of eVB? Perhaps eVC could be used to handle the intense graphical components of a game such as sprites and sound, and eVB could be used for the overall logic of the game. The eVB application could be notified by the eVC component when certain events have occurred - for example, user input or sprite collisions.

The ASpriteCE Game Control is just that - a component coded in eVC that can be married with eVB to create some pretty fast games. ASpriteCE has methods for creating and managing sprites, sounds, backgrounds, scrolling, and even tiled maps. In this article, I'll give a quick introduction to ASpriteCE by exploring some of it's core methods. We'll create a sample game that demonstrates sprites and getting user input.

To begin, you will need to install a copy of the ASpriteCE Game Control - you don't have to buy it, the trial version will work - downloaded from www.spritehand.com. Be sure to run the install.vbs file which will add registry entries needed to integrate the control into eVB. Then use the Control Manager in eVB (Tools/Remote Tools/Control Manager) to register ASpriteCE.dll to your device. You'll want to pick the appropriate processor build of ASpriteCE from the "bin" folder. If the registration fails, note that ASpriteCE.dll depends on atlce300.dll and gx.dll. If these are not on your PocketPC, don't worry - they're shipped with eVB and eVC in \Windows CE Tools\wce300\MS Pocket PC\. Just register those with Control Manager first.

In the rest of this article, we're going to create a classic Space Invaders style game called "DevBuzzards". In this game, the stoic DevBuzz PDA will destroy the evil DevBuzzards by shooting quality articles at them! We'll explore many of the basic methods and events required to make a cool game with ASpriteCE.


DevBuzzards in action.

Our first task is to create a form, initialize the ASpriteCE control and set the background image. Create an new PocketPC eVB project. Add ASpriteCE to the toolbox by selecting Project/Components and checking the "ASpriteCE Game Library". You will now see the Game Class icon appear in the toolbox. Select it and draw a new Game Window on Form1, making it about the size of the game window in the screenshot above (you don't have to be exact). Now add the following code to the Form_Load event:

Private Sub Form_Load()
' Initialize
Game1.DrawInit Form1.hWnd, 0, 0
' Draw a background
Game1.DrawBackgroundImage App.Path & "\backdrop.jpg", 0, 0
End Sub

Note that the DrawInit method must always be called before any other methods. The last two parameters of DrawInit are only used for scrolling games, so we can pass zeros in for them. The DrawBackgroundImage method is used to draw backdrop.jpg at the upper left corner of the Game Window.

Our next task is to define our sprites from the image files. Take a look at the images below used in DevBuzzards. Of special note is the buzzard sprite which is 180 X 16 and contains 5 frames, each frame being 36 X 16 pixels. ASpriteCE makes it pretty easy to define multi-framed sprites like the buzzard.

Next Page 

Back to Starting Out | [Article Index]

 

Back to the top of the page.
Chris De Herrera's Windows CE Website Windows CE News & Information Source
Copyright ©2000-2007 by DEVBUZZ.COM, Inc., NJ. USA.MSDEVELOP