public BlockObject(PrehenderGame bbg,Vector3 pLocation, Vector3 pSize, Vector3 pVelocity) { _Location = pLocation; _Size = pSize; _Velocity = pVelocity; FaceTextures = new Dictionary<BlockFaceConstants, string>(){ {BlockFaceConstants.Front, "Generic_1"}, {BlockFaceConstants.Back, "Generic_2"}, {BlockFaceConstants.Top, "Generic_3"}, {BlockFaceConstants.Bottom,"Generic_4"}, {BlockFaceConstants.Left,"Invincible"}, {BlockFaceConstants.Right,"Strong1"}}; foreach (var iterate in Enum.GetValues(typeof(BlockFaceConstants))) { FaceColors.Add((BlockFaceConstants)iterate, Color.FromArgb(128,Color.White)); } foreach (var iterate in Enum.GetValues(typeof(BlockFaceConstants))) { ActiveFaceColors.Add((BlockFaceConstants)iterate, Color.FromArgb(128, Color.Orange)); } BlockBody = new RigidBody(new BoxShape(_Size.X, _Size.Y, _Size.Z)); BlockBody.AffectedByGravity = false; BlockBody.IsStatic = true; BlockBody.Mass = 5; BlockBody.Tag = this; BlockBody.Position = new JVector(_Location.X, _Location.Y, _Location.Z); //bbg.PhysicsWorld.AddBody(BlockBody); }
public GameBlock(PrehenderGame bbg, Vector3 pLocation, Vector3 pSize, Vector3 pVelocity, Color useColor) : this(bbg, pLocation, pSize, pVelocity) { _ElementColor = useColor; var copied = FaceTextures.Keys.ToList(); foreach (var iterate in copied) { FaceTextures[iterate] = selectableTextures[_ElementColor]; } }
protected GameState(PrehenderGame OwnerGame) { _OwnerWindow = OwnerGame; _OwnerWindow.Mouse.ButtonDown += Mouse_ButtonDown; _OwnerWindow.Mouse.ButtonUp += Mouse_ButtonUp; _OwnerWindow.Mouse.Move += Mouse_Move; _OwnerWindow.Mouse.WheelChanged += Mouse_WheelChanged; _OwnerWindow.Keyboard.KeyDown += Keyboard_KeyDown; _OwnerWindow.Keyboard.KeyUp += Keyboard_KeyUp; }
public Ball(World physicsWorld,PrehenderGame game,Vector3 pLocation, Vector3 pVelocity, double pRadius = 3) { _Location = pLocation; _Velocity = pVelocity; _Radius = pRadius; rb = new RigidBody(new SphereShape((float)_Radius)); rb.Position = new JVector(pLocation.X, pLocation.Y, pLocation.Z); rb.LinearVelocity = new JVector(pVelocity.X, pVelocity.Y, pVelocity.Z); rb.Mass = 50; rb.Tag = this; physicsWorld.AddBody(rb); }
public override void Update(PrehenderGame bbg, FrameEventArgs e) { //no update! }
public override void Render(PrehenderGame bbg, FrameEventArgs e) { //render the paused state... _PausedState.Render(bbg, e); }
public PausedGameState(PrehenderGame Owner) : this(Owner,Owner.currentState,Owner.currentState) { }
public PausedGameState(PrehenderGame Owner,GameState PreviousState,GameState ResumeState) : base(Owner) { _PausedState = PreviousState; _ResumeState = ResumeState; }
public void Apply(PrehenderGame ToGame) { }
public bool Invoke(PrehenderGame mGame) { return _Routine(mGame); }
public PrehenderGame() { if(instance==null) instance = this; }
public GameBlock(PrehenderGame bbg, Vector3 pLocation, Vector3 pSize, Vector3 pVelocity) : base(bbg, pLocation, pSize, pVelocity) { }
public abstract void Update(PrehenderGame bbg, FrameEventArgs e);
public virtual void RenderHUD(PrehenderGame bbg, FrameEventArgs e) { }
public abstract void Render(PrehenderGame bbg,FrameEventArgs e);