Changeset 2231


Ignore:
Timestamp:
2011-06-28 14:28:38 (8 years ago)
Author:
teeevasa
Message:

Talletus.

Location:
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Enemy.cs

    r2227 r2231  
    66using Jypeli.Widgets; 
    77 
    8 public class Enemy : GenCharacter 
     8public class GenEnemy : GenCharacter 
    99{ 
    1010    private string AItype 
     
    1414    } 
    1515 
    16     public Enemy(double width, double height, Shape shape, int HP, string AI) 
     16    public GenEnemy(double width, double height, Shape shape, int HP, string AI) 
    1717        : base(width, height, shape) 
    1818    { 
     
    2424// Defines the functions that are required from all AIs 
    2525interface AI 
    26 {  
    27  
     26{ 
     27    void move(); 
    2828} 
    2929 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/GenCharacter.cs

    r2219 r2231  
    3030 
    3131    // Players and enemies have different ways of attacking 
    32     private abstract void attack(); 
     32    //public abstract void attack(); 
    3333 
    3434    // A particlular method for reducing hit points. It also handles death, when it  
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs

    r2227 r2231  
    2727    void createLevel() 
    2828    { 
    29         TileMap ruudut = TileMap.FromFile("ReactorEntrance.txt"); 
    30         ruudut['='] = createVerticalBlock; 
    31         ruudut['|'] = createHorizontalBlock; 
    32         ruudut['P'] = addPlayer; 
    33         ruudut['a'] = addMeleeAlien; 
    34         ruudut.Insert(SCREEN_WIDTH, SCREEN_HEIGTH); 
     29        TileMap levelSpec = TileMap.FromFile("ReactorEntrance.txt"); 
     30        levelSpec['='] = createVerticalBlock; 
     31        levelSpec['|'] = createHorizontalBlock; 
     32        levelSpec['P'] = addPlayer; 
     33        levelSpec['a'] = addMeleeAlien; 
     34        levelSpec.Insert(SCREEN_WIDTH, SCREEN_HEIGTH); 
    3535    } 
    3636 
    37     void addPlayer() 
     37    Player addPlayer() 
    3838    { 
    39   
     39        player = new Player(10.0, 10.0, Shape.Rectangle); 
     40        return player; 
    4041    } 
    4142 
    42     void addMeleeAlien() 
    43     {  
    44      
     43    MeleeAlien addMeleeAlien() 
     44    { 
     45        MeleeAlien meleeAlien = new MeleeAlien(); 
     46        return meleeAlien; 
    4547    } 
    4648 
    47     void createHorizontalBlock() 
    48     {  
    49      
     49    PhysicsObject createHorizontalBlock() 
     50    { 
     51        PhysicsObject hBlock = PhysicsObject.CreateStaticObject(SCREEN_WIDTH, SCREEN_HEIGTH); 
     52        hBlock.Color = Color.Black; 
     53        return hBlock; 
    5054    } 
    5155 
    52     void createVerticalBlock() 
    53     {  
    54      
     56    PhysicsObject createVerticalBlock() 
     57    { 
     58        PhysicsObject vBlock = PhysicsObject.CreateStaticObject(SCREEN_WIDTH, SCREEN_HEIGTH); 
     59        vBlock.Color = Color.Red; 
     60        return vBlock; 
    5561    } 
    5662} 
Note: See TracChangeset for help on using the changeset viewer.