1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. package Entities.Sprites.Keen4 is 
  10.  
  11.     -- Class ID's for classes of sprites 
  12.  
  13.     -- ghosts of collected items 
  14.     Blue_1UP_Tag        : constant String := "Entities.Sprites.Keen4.Blue_1UP"; 
  15.     Collect_Drop_Tag    : constant String := "Entities.Sprites.Keen4.Collect_Drop"; 
  16.     Collect_Gem_Tag     : constant String := "Entities.Sprites.Keen4.Collect_Gem"; 
  17.     Collect_Stunner_Tag : constant String := "Entities.Sprites.Keen4.Collect_Stunner"; 
  18.     Points_100_Tag      : constant String := "Entities.Sprites.Keen4.Points_100"; 
  19.     Points_200_Tag      : constant String := "Entities.Sprites.Keen4.Points_200"; 
  20.     Points_500_Tag      : constant String := "Entities.Sprites.Keen4.Points_500"; 
  21.     Points_1000_Tag     : constant String := "Entities.Sprites.Keen4.Points_1000"; 
  22.     Points_2000_Tag     : constant String := "Entities.Sprites.Keen4.Points_2000"; 
  23.     Points_5000_Tag     : constant String := "Entities.Sprites.Keen4.Points_5000"; 
  24.     Yellow_1UP_Tag      : constant String := "Entities.Sprites.Keen4.Yellow_1UP"; 
  25.  
  26.     -- flags on the overhead world 
  27.     Flag_Tag            : constant String := "Entities.Sprites.Keen4.Flag"; 
  28.     Flag_Up_Tag         : constant String := "Entities.Sprites.Keen4.Flag_Up"; 
  29.  
  30.     -- stunner shots 
  31.     Stunner_Blast_Tag   : constant String := "Entities.Sprites.Keen4.Stunner_Blast"; 
  32.     Stunner_Shot_Tag    : constant String := "Entities.Sprites.Keen4.Stunner_Shot"; 
  33.  
  34.     ---------------------------------------------------------------------------- 
  35.  
  36.     -- Spawns a raising flag sprite that flys toward (x, y) and is then replaced 
  37.     -- by a stationary flying flag sprite. 
  38.     procedure Spawn_Raising_Flag( x, y : Float ); 
  39.  
  40. private 
  41.  
  42.     type Collect_Item is new Sprite with null record; 
  43.  
  44.     procedure Construct( this   : access Collect_Item; 
  45.                          tileId : Natural ); 
  46.  
  47.     function Object_Input( stream : access Root_Stream_Type'Class ) return Collect_Item; 
  48.     for Collect_Item'Input use Object_Input; 
  49.  
  50.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Collect_Item ); 
  51.     for Collect_Item'Read use Object_Read; 
  52.  
  53.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Collect_Item ); 
  54.     for Collect_Item'Write use Object_Write; 
  55.  
  56.     ---------------------------------------------------------------------------- 
  57.  
  58.     type Collect_Drop is new Sprite with null record; 
  59.  
  60.     procedure Construct( this : access Collect_Drop ); 
  61.  
  62.     function Object_Input( stream : access Root_Stream_Type'Class ) return Collect_Drop; 
  63.     for Collect_Drop'Input use Object_Input; 
  64.  
  65.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Collect_Drop ); 
  66.     for Collect_Drop'Read use Object_Read; 
  67.  
  68.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Collect_Drop ); 
  69.     for Collect_Drop'Write use Object_Write; 
  70.  
  71.     ---------------------------------------------------------------------------- 
  72.  
  73.     type Flag is new Sprite with null record; 
  74.  
  75.     procedure Construct( this : access Flag ); 
  76.  
  77.     function Object_Input( stream : access Root_Stream_Type'Class ) return Flag; 
  78.     for Flag'Input use Object_Input; 
  79.  
  80.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Flag ); 
  81.     for Flag'Read use Object_Read; 
  82.  
  83.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Flag ); 
  84.     for Flag'Write use Object_Write; 
  85.  
  86.     ---------------------------------------------------------------------------- 
  87.  
  88.     type Flag_Up is new Sprite with 
  89.         record 
  90.             playedSound : Boolean := False;       -- played its sound effect? 
  91.         end record; 
  92.  
  93.     procedure Construct( this : access Flag_Up ); 
  94.  
  95.     procedure Update( this : access Flag_Up; time : Tick_Time ); 
  96.  
  97.     function Object_Input( stream : access Root_Stream_Type'Class ) return Flag_Up; 
  98.     for Flag_Up'Input use Object_Input; 
  99.  
  100.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Flag_Up ); 
  101.     for Flag_Up'Read use Object_Read; 
  102.  
  103.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Flag_Up ); 
  104.     for Flag_Up'Write use Object_Write; 
  105.  
  106.     ---------------------------------------------------------------------------- 
  107.  
  108.     type Stunner_Blast is new Sprite with null record; 
  109.  
  110.     procedure Construct( this : access Stunner_Blast ); 
  111.  
  112.     function Object_Input( stream : access Root_Stream_Type'Class ) return Stunner_Blast; 
  113.     for Stunner_Blast'Input use Object_Input; 
  114.  
  115.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Stunner_Blast ); 
  116.     for Stunner_Blast'Read use Object_Read; 
  117.  
  118.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Stunner_Blast ); 
  119.     for Stunner_Blast'Write use Object_Write; 
  120.  
  121.     ---------------------------------------------------------------------------- 
  122.  
  123.     type Stunner_Shot is new Sprite with null record; 
  124.  
  125.     procedure Construct( this : access Stunner_Shot ); 
  126.  
  127.     function Object_Input( stream : access Root_Stream_Type'Class ) return Stunner_Shot; 
  128.     for Stunner_Shot'Input use Object_Input; 
  129.  
  130.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Stunner_Shot ); 
  131.     for Stunner_Shot'Read use Object_Read; 
  132.  
  133.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Stunner_Shot ); 
  134.     for Stunner_Shot'Write use Object_Write; 
  135.  
  136.     procedure On_Collide( this : access Stunner_Shot; e : not null A_Entity ); 
  137.  
  138.     procedure On_Hit_Wall( this         : access Stunner_Shot; 
  139.                            dir          : Cardinal_Direction; 
  140.                            firstContact : Boolean ); 
  141.  
  142. end Entities.Sprites.Keen4;