Ranjit

15 September, 2009

How to create games using JavaScript

How to create games using JavaScript


Introduction

Is it possible to create games using JavaScript? You bet it is - you can design any kind of game your imagination permits, but if you create shoot-them-ups you should keep in mind that they will be a little slower compared to compiled languages such as C++ or C#.
If you like to learn by example, here are two logical games you can tinker with:
  • JavaScript Chess. Yes, here is the entire chess engine written in JavaScript. Pit your wits against the computer...
    ... and unlike Deep Fritz, this one you can actually beat and feel good about it!
  • Button Mania. The goal is simple - but getting there requires lots of thinking. Great logical game!
If you prefer games where things are moving, exploding and being shot at, it is easy to make them in JavaScript provided that you know how to handle various events as they appear, and the physics affecting the objects in the game.

Fundamentals of Game Programming

Pre-requisites: 3D Anatomy 101, 3D Graphics 101
Description: Fundamentals of Game Programming
Difficulty: Intermediate
Duration: 13 Lessons (approx)
Assignments: 1 game development project
Exam: 1
Software: 3D Game Builder (available below)
Available for: Any Windows PC or "netbook" (XP)
Delivery: On-line (or contact us for off-line content)




Learning Outcomes


  • Game Programming using C and C++


  • 2D and 3D Graphics Programming using OpenGL


  • Matrix functions control view and object locations


  • Arrays can be used to manage multiple objects


  • Targeting and collisions require distance calculation


  • Game pad / controller state needs to be checked every frame


  • Game speed should to be syncronised with time


  • Model matrix is used to locate and rotate objects


  • Angles are converted to x,y using cosine and sine


  • Limits must be applied to objects to keep them on screen


  • Perspective and Parallel view projections


  • Game world must have constraints and limits


  • Constants can be used to specify fixed quantities


  • Designing and developing games can be a lot of fun! 






  • Lesson Plans


    Session 1 - Getting Started

    To get started we show you how to create a simple hello world program using the 3D Game Builder SDK.
    Next we demonstrate how to draw geometric primitives using OpenGL. OpenGL is an industry standard graphics library for drawing 2D and 3D graphics. It is used to develop a wide range of software including 3D modelling and animation tools such as 3D Studio Max and Maya. It supports a wide range of hardware and operating systems from mobile phones to super computers. For more information on OpenGL visit www.opengl.org
    We use the language of game developers, C and C++, to develop our projects. This language can be challenging but it ensures you are using the same technology that the "real world" developers use. Therefore you are encouraged to learn more about C and C++ independently of this course.

    /
    /
    /
    /