ASP.NET
  Home arrow ASP.NET arrow .Netterpillars: Artificial Intelligence an...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

.Netterpillars: Artificial Intelligence and Sprites
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 2
    2005-01-04

    Table of Contents:
  • .Netterpillars: Artificial Intelligence and Sprites
  • Object-Oriented Programming
  • Artificial Intelligence
  • Line of Sight
  • Use Your Imagination
  • Coding the Sprite Attributes
  • The Game Proposal
  • The Sprite Class
  • The Main Program Structure

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    .Netterpillars: Artificial Intelligence and Sprites


    (Page 1 of 9 )

    Learn about artificial intelligence while creating a computer game. This article is excerpted from chapter two of the book Beginning .NET Game Programming in C#, by Ellen Hatton et. al. (Apress, 2004, ISBN: 1590593197) and is the first of two parts.

    IN THIS CHAPTER, WE’LL INTRODUCE YOU to the concepts of artificial intelligence (AI) and sprites. You’ll also get a chance to extend your knowledge of GDI+ functions, including some tips intended to give your games a boost in performance. To accomplish these goals and illustrate these concepts, we’ll walk you through the steps for creating a game called .Netterpillars (see Figure 2-1).


    Figure 2-1.  .Netterpillars, this chapter's sample game

    .Netterpillars is an arcade game in which each player controls a caterpillar (in fact, a netterpillar) that takes part in a mushroom-eating race with other netterpillars. The objective of the game is to be the last surviving netterpillar, or the longest one (they grow when they eat) when every mushroom has been eaten.

    We’ll describe the game in more detail in the section “The Game Proposal” later in this chapter.

    .Netterpillars is a more complex game than the one you saw in the last chapter because it involves the following components:

    • AI: Creating a game with opponents will make you exercise your ability to create a computer-controlled character that challenges players, while giving them a fair chance of winning.

    • Sprites: Using nonrectangular game objects will force you to find a way to draw them on the screen in a simple, efficient manner. Including a background image in your game screen will help you to check whether your moving code is working (remember, in the last chapter you simply painted the objects with the flat background color).

    • GDI+: Creating an interface where many objects (one to four caterpillars, wooden branches, and a lot of mushrooms) will be drawn and interact with each other will challenge you to find a faster way to update the screen.

    While covering these topics, you’ll also look at new concepts related to object-oriented programming so you can create easily reusable classes to improve productivity when coding your games. For example, a Sprite class is something that almost any game will need; so you can code it once and use it forever. We’ll discuss all these points in the next sections, starting with some object-oriented concepts. 

    This chapter is from Beginning .NET Game Programming in C# by Ellen Hatton et al. (Apress, 2004, ISBN: 1590593197). Check it out at your favorite bookstore today. Buy this book now.

    More ASP.NET Articles
    More By Apress Publishing


     

    ASP.NET ARTICLES

    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway