Game Development Reference
In-Depth Information
Figure 10.6
Scrolling backgrounds.
_textureManager.LoadTexture("enemy_ship", "spaceship2.tga");
Once this has been added, a class can be constructed to simply represent the
enemy.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Engine;
namespace Shooter
{
class Enemy
{
Sprite _spaceship
¼
new Sprite();
double _scale
¼
0.3;
public Enemy(TextureManager textureManager)
{
_spaceship.Texture
¼
textureManager.Get("enemy_ship");
Search WWH ::
Custom Search