private void updateInput(KeyboardState ks, KeyboardState oldks) { if (allowMovement) { if (onGround) { if (ks.IsKeyDown(Keys.Right)) { alterVelocityAdition(new Vector2(verticalSpeedGround + deceleration, 0)); } if (ks.IsKeyDown(Keys.Left)) { alterVelocityAdition(new Vector2(-(verticalSpeedGround + deceleration), 0)); } } else { if (ks.IsKeyDown(Keys.Right)) { alterVelocityAdition(new Vector2(verticalSpeedAir + deceleration, 0)); } if (ks.IsKeyDown(Keys.Left)) { alterVelocityAdition(new Vector2(-(verticalSpeedAir + deceleration), 0)); } } } if (allowJump) { if (onGround && ks.IsKeyDown(Keys.Up)) { velocity.Y = -jumpStrength; //TODO: FIX THIS WORKAROUND! //alterPositionAdition(new Point(0,-3)); //for debug } } if (ks.IsKeyDown(Keys.Down)) { //alterPositionAdition(new Point(0,3)); //for debug } if (ks.IsKeyDown(Keys.X) && !oldks.IsKeyDown(Keys.X)) { Game1.getCurrentGameMode().addProjectile(new Projectile(new Point(), new Vector2(), innerColorEnum)); innerColorPoolMissing++; innerRectangle.Height = innerRectangle.Height * (innerColorPoolMissing / innerColorPoolMax); /* Game1.okColors holder = Game1.getSecondaryColor(); * Game1.setSecondaryColor(Game1.getBackgroundColor()); * Game1.setBackgroundColor(holder); */ } if (ks.IsKeyDown(Keys.Z) && !oldks.IsKeyDown(Keys.Z)) { Game1.okColors holder = Game1.getPrimraryColor(); Game1.setPrimaryColor(Game1.getBackgroundColor()); Game1.setBackgroundColor(holder); } }
private void loadDEMO2() { originalPrimraryColor = Game1.okColors.BLACK; originalSecondaryColor = Game1.okColors.ORANGE; originalBackgroundColor = Game1.okColors.WHITE; loadFromFile("DEMO2"); nextLevel = levels.DEMO1; }
private void addBarrier(Point position, Point _barrierSize) { barriers.Add(new Barrier(new Rectangle(position.X, position.Y, _barrierSize.X, _barrierSize.Y), barrierColor)); barriers.Add(new Barrier(new Rectangle(position.X, 0, _barrierSize.X, groundHeight - _barrierSize.Y), barrierBlockColor)); barrierBlockColor = Game1.getBackgroundColor(); groundColor = barrierBlockColor; }
private void setUp() { groundColor = Game1.getPrimraryColor(); for (int i = 0; i < Game1.getScreenSize().X / barrierSize + 1; i++) { addGround(new Point(i * barrierSize, groundHeight)); } }
public EndlessRunner() { groundColor = Game1.getPrimraryColor(); barrierColor = Game1.getPrimraryColor(); barrierBlockColor = Game1.getSecondaryColor(); player = new Player(new Rectangle(startPos, playerSize), Game1.getPrimraryColor(), Game1.getSecondaryColor(), false); ground = new List<Barrier>(); barriers = new List<Barrier>(); colorBlobs = new List<ColorBlob>(); betweenBerriers = 1000; setUp(); }
public EndlessRunner() { groundColor = Game1.getPrimraryColor(); barrierColor = Game1.getPrimraryColor(); barrierBlockColor = Game1.getSecondaryColor(); player = new Player(new Rectangle(startPos, playerSize), Game1.getPrimraryColor(), Game1.getSecondaryColor(), false); ground = new List <Barrier>(); barriers = new List <Barrier>(); colorBlobs = new List <ColorBlob>(); betweenBerriers = 1000; setUp(); }
public Player(Rectangle dimensions, Game1.okColors outerColorEnum, Game1.okColors innerColorEnum, bool allowMovement = true, bool allowJump = true) { this.dimensions = new AABB(dimensions); this.outerColorEnum = outerColorEnum; this.innerColorEnum = innerColorEnum; this.allowMovement = allowMovement; this.allowJump = allowJump; this.velocity = new Vector2(0); this.onGround = false; this.innerColorPoolMissing = 0; this.innerColorPoolMax = 3; this.innerRectangle = this.dimensions.getBoundingBox(); innerRectangle.Width -= innerBorder * 2; innerRectangle.Height -= innerBorder * 2; }
public Projectile(Point position, Vector2 velocity, Game1.okColors colorEnum) { this.dimentions = new AABB(position, size); this.velocity = velocity; this.colorEnum = colorEnum; }
public ColorBlob(Rectangle dimensions, Game1.okColors colorEnum) { this.dimensions = new AABB(dimensions); this.colorEnum = colorEnum; }
private void addBarrier(Point position, Point _barrierSize) { barriers.Add(new Barrier(new Rectangle( position.X, position.Y, _barrierSize.X, _barrierSize.Y), barrierColor ) ); barriers.Add(new Barrier(new Rectangle( position.X, 0, _barrierSize.X, groundHeight - _barrierSize.Y), barrierBlockColor ) ); barrierBlockColor = Game1.getBackgroundColor(); groundColor = barrierBlockColor; }
public Barrier(Rectangle dimensions, Game1.okColors colorEnum) { this.dimensions = new AABB(dimensions); this.colorEnum = colorEnum; }
public void setInnerColor(Game1.okColors colorEnum) { this.innerColorEnum = colorEnum; }
public void setOuterColor(Game1.okColors colorEnum) { this.outerColorEnum = colorEnum; }