Changeset 5386 for 2014/27


Ignore:
Timestamp:
2014-07-03 15:28:38 (5 years ago)
Author:
mijoilmo
Message:
 
Location:
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Hud.cs

    r5359 r5386  
    1111    private Player boundPlayer; 
    1212    private Radar radar; 
    13     public Hud(Proto236b parent,ScreenView screen) : base(screen.Width,screen.Height) 
     13    public Hud(Proto236b parent) : base(parent.GameScreen.Width,parent.GameScreen.Height) 
    1414    { 
    1515        this.boundPlayer = parent.Player; 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Player.cs

    r5359 r5386  
    8080            this.X = parent.Level.Right; 
    8181        } 
    82         if (parent.CurrentLevel.IsPlanet && this.Y > parent.Level.Top) 
     82        if (parent.CurrentLevel.IsPlanet && this.Y > parent.Level.Top - parent.GameScreen.Height / 2 + parent.Level.Height / 2) 
    8383        { 
    8484            //player pystyy lähteä pois planeetalta kun menee tarpeeksi ylös 
    8585            //TODO: vaihda leveli spaceksi 
     86            parent.MessageDisplay.Add("Mennään avaruuteen"); 
    8687        } 
    8788    } 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs

    r5369 r5386  
    2020    private ProtoLevel currentLevel; 
    2121    public ProtoLevel CurrentLevel { get { return currentLevel; } set { currentLevel = value; } } 
     22    private ScreenView gameScreen; 
     23    public ScreenView GameScreen { get { return gameScreen; } set { gameScreen = value; } } 
    2224 
    2325    void AssignKeys() 
     
    6264        LevelFromImage("graphics/levels/" + level.TileMapSrc); 
    6365    } 
     66    void CreateBg(string id,int offset) { 
     67        GameObject bg = new GameObject(Level.Width, Level.Height); 
     68        bg.Image = images[id]; 
     69        bg.X += Level.Width * offset; 
     70        bg.Y += Level.Height / 2; 
     71        Add(bg, -3); 
     72    } 
    6473    void LevelFromImage(string levelName) 
    6574    { 
     
    97106 
    98107        //luo backgroundit (3) 
    99  
    100         GameObject bgCenter = new GameObject(Level.Width,Level.Height); 
    101         bgCenter.Image = images["backgroundplanet1"]; 
    102         Add(bgCenter, -3); 
    103         GameObject bgLeft = new GameObject(Level.Width, Level.Height); 
    104         bgLeft.Image = images["backgroundplanet1"]; 
    105         bgLeft.X += Level.Width; 
    106         Add(bgLeft, -3); 
    107         GameObject bgRight = new GameObject(Level.Width, Level.Height); 
    108         bgRight.Image = images["backgroundplanet1"]; 
    109         bgRight.X -= Level.Width; 
    110         Add(bgRight, -3); 
     108        CreateBg("backgroundplanet1", -1); 
     109        CreateBg("backgroundplanet1", 0); 
     110        CreateBg("backgroundplanet1", 1); 
    111111    } 
    112112    void initializeHUD() 
    113113    { 
    114         hud = new Hud(this,Screen); 
     114        hud = new Hud(this); 
    115115    } 
    116116    void createTile(Vector position, double w, double h, string id) 
     
    135135        // TODO: Kirjoita peli tähän 
    136136        LoadAllImages(); 
     137 
    137138        this.player = new Player(this); 
    138139        this.player.attachWeapon(); 
    139140        this.player.IsUpdated = true; 
     141 
     142        this.gameScreen = Screen; 
     143 
    140144        LoadLevel(new ProtoLevel(this, "standardi", true));//tää on huono metodi, TODO: luo level-classit ennen lataamista 
    141145    } 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Radar.cs

    r5369 r5386  
    2020        { 
    2121            //planet radar 
    22             this.planet = new GameObject(100, 100); 
     22            this.planet = new GameObject(133, 133); 
    2323            planet.Shape = Shape.Circle; 
    2424            Add(planet); 
     
    3636        this.ship.X = 0; 
    3737        this.ship.Y = 0; 
    38         double length = (parent.Player.Y - parent.Level.Bottom)/parent.Level.Height * 20 + 40; 
     38        double length = ((parent.Player.Y-(parent.Level.Bottom+parent.Level.Height/2))/parent.Level.Height)*22+66; 
    3939        this.ship.Position += Vector.FromLengthAndAngle(length,Angle.RightAngle); 
    4040        base.Update(time); 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/ContentPipeline-{5156C658-EF8C-4216-BA6D-9928D133FE72}.xml

    r5369 r5386  
    126126      <Options>None</Options> 
    127127      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\levels\standardi.xnb</Output> 
    128       <Time>2014-07-03T14:55:35.266651+03:00</Time> 
     128      <Time>2014-07-03T14:57:26.4677614+03:00</Time> 
    129129    </Item> 
    130130    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.