Vector2 levelSize; // in pixels, after scaling #endregion Fields #region Constructors public Level(GameplayScreen g, String bgKey, String bmKey, int size_x, int size_y) : base(g, 1280 / 2, 720 / 2, (int)(size_x / LEVEL_SCALE), 300, bgKey, LEVEL_SCALE) { this.background = g.textureDict["room2"]; Texture2D bitmap = g.textureDict["room2-collision-map"]; Color[] colormap = new Color[bitmap.Width * bitmap.Height]; this.bitmap = new bool[bitmap.Width * bitmap.Height]; bitmap.GetData<Color>(colormap); for (int i = 0; i < colormap.Length; i++) { if (colormap[i] == Color.Black) { this.bitmap[i] = true; } else { this.bitmap[i] = false; } } bitmapWidth = bitmap.Width; bitmapHeight = bitmap.Height; this.levelSize = new Vector2(size_x, size_y); }
public AttackingDude(GameplayScreen g, int posX, int posY, int frameWidth, int attackFrameWidth, String textureLeft, String textureRight, String textureAttackLeft, String textureAttackRight, float scale) : base(g, posX, posY, frameWidth, textureLeft, textureRight, scale) { this.textureAttackLeft = textureAttackLeft; this.textureAttackRight = textureAttackRight; this.attackFrameWidth = attackFrameWidth; }
public Entity(GameplayScreen g, int posX, int posY, int frameWidth, String textureName, float scale) { this.context = g; this.scaleBack = scale; id = next_id; next_id++; worldPosBack = new Vector2(posX, posY); changeAnimation(frameWidth, textureName); }
public DoctorWall(GameplayScreen g, Vector2 position, bool horizontal) : base(g, (int)position.X, (int)position.Y, frameWidth, textureName, SCALE) { this.frameTime = 30; // Change parameters if actually horizontal this.horizontal = horizontal; if (horizontal) { StateChange sc = StateChangeFactory.createChangeSpriteStateChange(id, 255, textureName, GetFrameTime()); notifyStateChangeListeners(sc); } }
public Wizard(GameplayScreen g, int posX, int posY) : base(g, posX, posY, FRAME_WIDTH, ATK_FRAME_WIDTH, TEXTURE_LEFT, TEXTURE_RIGHT, TEXTURE_ATTACK_LEFT, TEXTURE_ATTACK_RIGHT) { }
public Laser(GameplayScreen g, Vector2 position, Vector2 velocity) : base(g, (int)position.X, (int)position.Y, frameWidth, textureName, SCALE) { this.velocity = velocity; this.frameTime = 30; }
public PlayerCharacter(GameplayScreen g, int posX, int posY, int frameWidth, int attackFrameWidth, String textureLeft, String textureRight, String textureAttackLeft, String textureAttackRight) : base(g, posX, posY, frameWidth, attackFrameWidth, textureLeft, textureRight, textureAttackLeft, textureAttackRight, SCALE) { }
public MageAttack(GameplayScreen g, Vector2 position, Vector2 velocity) : base(g, (int)position.X, (int)position.Y, frameWidth, textureName, 3) { this.velocity = velocity; this.frameTime = 30; }
public GameState(GameplayScreen g) { context = g; }
// TODO: we can use this to build levels with various params public static Level generateLevel(GameplayScreen g) { //return new Level(g, "room2", "room2-collision-map", 1920, 1800); return new Level(g, "room2", "room2-collision-map", 1826,1530); }
public Bullet(GameplayScreen g, Vector2 position, Vector2 velocity) : base(g, (int)position.X, (int)position.Y, frameWidth, textureName, SCALE) { this.velocity = velocity; }
public OrientalDude(GameplayScreen g, int posX, int posY, int frameWidth, String textureLeft, String textureRight, float scale) : base(g, posX, posY, frameWidth, textureLeft, scale) { this.textureLeft = textureLeft; this.textureRight = textureRight; }
public HealthBar(GameplayScreen context, Entity parent) : base(context, (int)parent.worldPosition.X, (int)(parent.worldPosition.Y - 45), frameWidthBack, backTextureName, 1) { healthBatch = context.textureDict[chunkTextureName]; }
public Dude(GameplayScreen g, int posX, int posY, int frameWidth, String defaultTexture, float scale) : base(g, posX, posY, frameWidth, defaultTexture, scale) { health = getMaxHealth(); this.defaultTexture = defaultTexture; }