home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / xenon / source / creditsstate.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-11  |  3.2 KB  |  126 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CCreditsState
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CGameState
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #include "game.h"
  16.  
  17. //-------------------------------------------------------------
  18.  
  19. CCreditsState *CCreditsState::m_instance = 0;
  20.  
  21. //-------------------------------------------------------------
  22.  
  23. CCreditsState::CCreditsState()
  24. {
  25. }
  26.  
  27. //-------------------------------------------------------------
  28.  
  29. CCreditsState::~CCreditsState()
  30. {
  31. }
  32.  
  33. //-------------------------------------------------------------
  34.  
  35. CGameState *CCreditsState::instance()
  36. {
  37.     if (!m_instance)
  38.         m_instance = new CCreditsState;
  39.  
  40.     return m_instance;
  41. }
  42.  
  43. //-------------------------------------------------------------
  44.  
  45. bool CCreditsState::create()
  46. {
  47.     m_scroll_pos = 480;
  48.  
  49.     return true;
  50. }
  51.  
  52. //-------------------------------------------------------------
  53.  
  54. bool CCreditsState::update()
  55. {
  56.     if (!CGameState::update())
  57.         return false;
  58.  
  59.     if (Options.getOption(OPTION_BACKDROP))
  60.         m_backdrop.draw(gsCPoint(0,0));
  61.     else
  62.         m_screen.clear(gsCColour(gsBLACK));
  63.  
  64.     m_starfield.move(4);
  65.     m_starfield.draw();
  66.  
  67.     m_medium_font.setTextCursor(gsCPoint(0,0 + m_scroll_pos));
  68.     m_medium_font.justifyString("Xenon 2000 : Project PCF");
  69.     
  70.     m_medium_font.setTextCursor(gsCPoint(0,50 + m_scroll_pos));
  71.     m_medium_font.justifyString("A Bitmap Brothers Production");
  72.  
  73.     m_small_font.setTextCursor(gsCPoint(0,100 + m_scroll_pos));
  74.     m_small_font.justifyString("Programming and Implementation:");
  75.  
  76.     m_medium_font.setTextCursor(gsCPoint(0,120 + m_scroll_pos));
  77.     m_medium_font.justifyString("John M Phillips");
  78.  
  79.     m_small_font.setTextCursor(gsCPoint(0,170 + m_scroll_pos));
  80.     m_small_font.justifyString("Concept And Level Design:");
  81.  
  82.     m_medium_font.setTextCursor(gsCPoint(0,190 + m_scroll_pos));
  83.     m_medium_font.justifyString("Ed Bartlett");
  84.  
  85.     m_small_font.setTextCursor(gsCPoint(0,240 + m_scroll_pos));
  86.     m_small_font.justifyString("Graphics Design:");
  87.  
  88.     m_medium_font.setTextCursor(gsCPoint(0,260 + m_scroll_pos));
  89.     m_medium_font.justifyString("Mark Coleman");
  90.  
  91.     m_small_font.setTextCursor(gsCPoint(0,310 + m_scroll_pos));
  92.     m_small_font.justifyString("Music And Sound Effects:");
  93.  
  94.     m_medium_font.setTextCursor(gsCPoint(0,330 + m_scroll_pos));
  95.     m_medium_font.justifyString("Chris Maule");
  96.  
  97.     m_small_font.setTextCursor(gsCPoint(0,380 + m_scroll_pos));
  98.     m_small_font.justifyString("A big thankyou to:");
  99.  
  100.     m_medium_font.setTextCursor(gsCPoint(0,400 + m_scroll_pos));
  101.     m_medium_font.justifyString("Mike and all at Bitmap HQ");
  102.     m_medium_font.setTextCursor(gsCPoint(0,420 + m_scroll_pos));
  103.     m_medium_font.justifyString("Dan Hutchinson");
  104.     m_medium_font.setTextCursor(gsCPoint(0,440 + m_scroll_pos));
  105.     m_medium_font.justifyString("Alison Beasley");
  106.  
  107.     m_scroll_pos--;
  108.  
  109.     m_screen.flip();
  110.  
  111.     if (m_scroll_pos == -480 ||
  112.         getKey() != gsKEY_NONE)
  113.         return changeState(CMainMenuState::instance());
  114.  
  115.     return true;
  116. }
  117.  
  118. //-------------------------------------------------------------
  119.  
  120. bool CCreditsState::destroy()
  121. {
  122.     return true;
  123. }
  124.  
  125. //-------------------------------------------------------------
  126.