/+junk/invaders_vala

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/invaders_vala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using SDL;
using SDLGraphics;
using SDLImage;

namespace invadersGame{
  public SDL.Surface GameObjectImage;
  
  class GameObject : Object{
    public struct MovmentVector {
      /** MovmentVector
       * Is used for storting a movement vector.
       * IE: if it should move up (y < 0), up (y > 0), left (x < 0),
       * right (x > 0).
       */
      int x;
      int y;
      int Speed; /* Maximum movement over Time */
      int Time; /* The time it takes to move */
    } //MovmentVector
    
    MovmentVector mMovmentVector;
    
    public GameObject(){
      GameObjectImage = SDLImage.load("media/images/null.png");
      mMovmentVector = {
                  Game.getRandom(SCREEN_WIDTH),
                  Game.getRandom(SCREEN_HEIGHT),
                  0,
                  0
                  };
      stdout.printf("X: %i, Y: %i\n", mMovmentVector.x, mMovmentVector.y);
      
      mMovmentVector.x = 10;
      
      stdout.printf("New X: %i, Y: %i\n", mMovmentVector.x, mMovmentVector.y);
    }
    
  }
}