Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple 2D 'Space Invaders' Clone In Silverlight

I want to make a simple 2d game in Silverlight, but it seems like things have changed since the last time I tried to make a game using mode 13h graphics. Can someone give me a run-down of how you'd go about it.

I just mean at a high-level, focusing on the silverlight-specific aspects; not general game design.

A fictional example might be: 'The main game loop shouldn't be a loop, use a DispatchTimer instead. Use a Canvas as the main drawing object; but realize that we don't bother drawing individual pixels - all of your in-game objects should be represented by controls. Be sure to set the 'UseHardwareFlag' to true'. Etc, etc...

like image 539
Rob P. Avatar asked Nov 06 '22 01:11

Rob P.


1 Answers

If you want to stick to the mode 13 way of programming have a look at the WriteableBitmap.

Some very nice demos here

I succeeded in porting Wolf3D (2 and a half D) to Silverlight this way. I used the CompositionTarget.Rendering event

EDIT

I also found this, it is less mode 13 and more in line with your example.

like image 177
Emond Avatar answered Nov 09 '22 15:11

Emond