Project categories

Project site header
Category
Games
Platform
Nintendo DS
Language
C++
Type
nCode project
Team members
2
Date
2010
State
Completed

Description

Animus is a side-scroll space shooter developed for the Nintendo DS system. The game is homebrew software developed with libnds, a DS library from devkitPro team. As my first DS project, I developed a 2d library on top of libnds to use in the game. That library provides classes and functions for sprite management, animated GUI elements, advanced sound effects...

My role in the project was everything related to programming, while my tem-mate cared about image and texture creation. The game consists in just one level, including a final boss. However, it includes many of the final features:

  • Dual screen management: top for game and bottom for HUD
  • External maps for levels
  • Checkpoint system
  • Extensible power up system
  • Configurable enemy waves
  • Final boss support
  • Weapon selectable and weapon levels
  • Integrated GUI with animated GUI elements
  • Sound effects and music

Images

Video

Code sample

The following source code shows the base class for player weapons. It includes two classes, one for bullets and one for weapons.

weapon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef NCODE_ANIMUS_WEAPON_H
#define NCODE_ANIMUS_WEAPON_H
 
#include <string>
#include <vector>
 
#include "game_entity.h"
 
 
namespace ncode
{
 
 
namespace animus
{
 
 
namespace
{
 
const char WEAPON_NORMAL[] = "weapon normal";
const char WEAPON_LASER[] = "weapon laser";
const char WEAPON_PROTECTION[] = "weapon protection";
 
}
 
 
 
class IBullet : public GameEntity
{
public:
IBullet ()
{
_entity_state = ENTITY_STATE_INACTIVE;
}
 
void SetActive (const bool active)
{
_entity_state = active ? ENTITY_STATE_ACTIVE : ENTITY_STATE_INACTIVE;
}
 
inline u16 GetPower () const
{
return _power;
}
 
virtual void EnemyCollide ()
{
_entity_state = ENTITY_STATE_INACTIVE;
_visible = false;
}
 
protected:
u16 _power;
};
 
 
 
 
class IWeapon
{
public:
IWeapon (const std::string& type) : _type (type)
{
}
 
virtual ~IWeapon() { }
 
virtual void Update (const int x, const int y, const bool shoot=true) { }
virtual void Draw () { }
 
const std::string& GetType ()
{
return _type;
}
 
u8 GetWeaponLevels () const
{
return _levels;
}
 
u8 GetCurrentLevel () const
{
return _current_level;
}
 
virtual void LevelUp () = 0;
 
std::vector<IBullet*>& GetBullets ()
{
return _bullets_vector;
}
 
protected:
u8 _levels;
u8 _current_level;
std::string _type;
 
std::vector<IBullet*> _bullets_vector;
};
 
 
 
 
IWeapon* WeaponFactory (const std::string& id);
 
 
 
}
 
 
}
 
#endif
 
 

Links

devkit Pro
devkit Pro site holds libnds library, used for Nintendo DS development.
libnds documentation
Documentation of libnds library.

NOTE! This site uses cookies and similar technologies.

This site uses cookies and similar technologies. If you not change browser settings, you agree to it. Learn more

I understand