Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer. Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Go Back  Xtreme Visual Basic Talk > > > Moving 2 sprites without using a timer.


Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2014, 01:28 PM
sjm2357 sjm2357 is offline
Newcomer
 
Join Date: Dec 2013
Posts: 4
Default Moving 2 sprites without using a timer.


Hi all,
I'm new to game programming so please excuse me if this has been asked before....

I've created a Pong game that uses a timer to control the main loop of the game, but I've seen another game (Pacman) that has multiple sprites moving at the same time without using a timer.
The Pacman game has classes for the sprites, does this remove the need for a timer? I mean does the game create a new thread for each of the sprites, or how is the game controlled?

Thanks,
Sean.
Reply With Quote
  #2  
Old 02-04-2014, 03:54 PM
snarfblam's Avatar
snarfblamMoving 2 sprites without using a timer. snarfblam is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Apr 2005
Location: USA
Posts: 896
Default

Using a timer is generally an uncommon method of driving a game engine. It's easy for beginners and works well enough for the simplest of games, but as you move on to more advanced projects it quickly becomes inadequate. Timers can be slow or imprecise, and worse, the precision can vary between machines.

Some games use an idle loop. In VB or C# this means updating your game every time the Application.Idle event fires.

In other cases, the timing of the game engine is managed by a graphics library. The game loop updates game logic, renders graphics, and then displays them on the screen, the latter two being done via the graphics library. XNA addresses this at a high level, helping you separate game logic from rendering logic and managing the timing and frame skipping. Lower-level libraries like DirectX and OpenGL leave some of this work up to the programmer.

The determine which method is used by a particular game, you would generally have to look at the code and see.
__________________
C# _VB.NET _
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer. Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer. Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
 
Moving 2 sprites without using a timer.
Moving 2 sprites without using a timer.
 
-->