Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/intro')
-rw-r--r--src/game/intro/Makefile.am6
-rw-r--r--src/game/intro/intro.cc59
-rw-r--r--src/game/intro/intro.h47
3 files changed, 111 insertions, 1 deletions
diff --git a/src/game/intro/Makefile.am b/src/game/intro/Makefile.am
index 66ea90d..fc5b019 100644
--- a/src/game/intro/Makefile.am
+++ b/src/game/intro/Makefile.am
@@ -1,2 +1,6 @@
-INCLUDES = -I$(top_srcdir)/src
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/game
METASOURCES = AUTO
+libintro_la_LDFLAGS = -avoid-version
+noinst_LTLIBRARIES = libintro.la
+libintro_la_SOURCES = intro.cc
+noinst_HEADERS = intro.h
diff --git a/src/game/intro/intro.cc b/src/game/intro/intro.cc
new file mode 100644
index 0000000..c0ae6da
--- /dev/null
+++ b/src/game/intro/intro.cc
@@ -0,0 +1,59 @@
+/*
+ intro/intro.cc
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
+*/
+
+#include "intro/intro.h"
+#include "sys/sys.h"
+
+namespace intro {
+
+Intro::Intro() : core::Module("Introduction")
+{
+ intro_zone = 0;
+}
+
+Intro::~Intro()
+{
+}
+
+void Intro::init()
+{
+ /// intialize a single zone for the introduction
+ intro_zone = new core::Zone("intro");
+ intro_zone->set_name("Introduction");
+ core::Zone::add(intro_zone);
+
+ /// add a planet
+ core::EntityGlobe *planet = new core::EntityGlobe();
+ planet->set_zone(intro_zone);
+ planet->set_name("Planet");
+ planet->set_label("planet");
+ planet->entity_texture.assign("planets/seymour");
+ planet->entity_location.assign(0, -32.0f, 0.0f);
+ planet->entity_radius = 64.0f;
+ planet->entity_rotationspeed = 1.0f;
+
+ module_running = true;
+}
+
+void Intro::player_connect(core::Player *player)
+{
+ player->set_zone(intro_zone);
+}
+
+void Intro::player_disconnect(core::Player *player)
+{
+}
+
+void Intro::frame(float seconds)
+{
+}
+
+void Intro::shutdown()
+{
+}
+
+}
+
diff --git a/src/game/intro/intro.h b/src/game/intro/intro.h
new file mode 100644
index 0000000..21dc604
--- /dev/null
+++ b/src/game/intro/intro.h
@@ -0,0 +1,47 @@
+/*
+ intro/intro.h
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_INTRO_H__
+#define __INCLUDED_INTRO_H__
+
+#include "core/core.h"
+
+/// introduction game module
+namespace intro
+{
+
+/// introduction game module
+class Intro : public core::Module
+{
+public:
+ /// create an introduction game module
+ Intro();
+ /// delete an introduction game module
+ ~Intro();
+
+ /// run the introduction
+ void init();
+
+ /// shutdown the introduction
+ void shutdown();
+
+ /// run one frame
+ void frame(float seconds);
+
+ /// is called when a player connects
+ void player_connect(core::Player *player);
+
+ /// is called when a player disconnects
+ void player_disconnect(core::Player *player);
+
+private:
+ core::Zone *intro_zone;
+};
+
+}
+
+#endif // __INCLUDED_INTRO_H__
+