public Boo(Game1 game, Vector2 booResetLocation) { myGame = game; physics = new PacMarioGamePhysics(); state = new UpPatrolingBooState(this); resetLocation = booResetLocation; }
public StartGameAdminCommand(int size, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository) { _size = size; _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; }
public WolverineEnemy(Game1 game) { myGame = game; isHit = false; canDealDamage = true; physics = new MarioGamePhysics(); state = new WolverineMovingLeftState(this); }
public Flower(bool isInsideBlock, Game1 game) { this.isInsideBlock = isInsideBlock; myGame = game; flowerSprite = ItemsSpriteFactory.CreateFlowerSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; }
public PacMario(Game1 game) { state = new PacMarioRightState(this); myGame = game; physics = new PacMarioGamePhysics(); isPressingDown = false; isDead = false; }
public GreenMushroom(bool isInsideBlock, Game1 game) { this.isInsideBlock = isInsideBlock; myGame = game; greenMushroomSprite = ItemsSpriteFactory.CreateGreenMushroomSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; }
public Endblock(Game1 game) { myGame = game; endblockSprite = LemmingSpriteFactory.CreateEndblockSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; physics.Velocity = Vector2.Zero; }
public Block(Type blockType, bool isUnderground, Game1 game) { isBumped = false; this.game = game; SetInitialState(blockType, isUnderground); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; }
public BuckeyePlayer(Game1 game) { state = new BuckeyeRightIdleState(this); myGame = game; physics = new MarioGamePhysics(); isPressingDown = false; isDead = false; spawner = new FootballSpawner(game); }
public MarioInstance(Game1 game) { state = new SmallRightIdleState(this); myGame = game; physics = new MarioGamePhysics(); factory = new FireBallSpawner(game); isPressingDown = false; isDead = false; }
public GreenKoopa(Game1 game) { myGame = game; physics = new MarioGamePhysics(); physics.VelocityMaximum = new Vector2(IEnemyObjectConstants.KOOPAMAXVELOCITY, physics.VelocityMaximum.Y); physics.VelocityMinimum = new Vector2(IEnemyObjectConstants.KOOPAMINVELOCITY, physics.VelocityMinimum.Y); state = new GreenKoopaWalkingLeftState(this); weaponizedShellKillStreak = 0; }
public ThrowingWolverineEnemy(Game1 game) { myGame = game; isHit = false; canDealDamage = true; physics = new MarioGamePhysics(); state = new WolverineLeftIdleState(this); spawner = new FootballSpawner(myGame); }
public PacMarioNormalCoin(bool isInsideBlock, Game1 game) { this.isInsideBlock = isInsideBlock; isReleased = false; myGame = game; coinSprite = ItemsSpriteFactory.CreateCoinSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; }
public WolverineChuck(Game1 game) { myGame = game; isHit = false; canDealDamage = true; physics = new MarioGamePhysics(); state = new WolverineChuckIdleLeftState(this); spawner = new FootballSpawner(myGame); }
public LeftFire(FireBallSpawner factory, Game1 game) { myGame = game; FireSprite = ProjectileSpriteFactory.CreateFireSprite(); physics = new MarioGamePhysics(); physics.Velocity = new Vector2(ProjectileConstants.LEFTFIREINITIALXVELOCITY, physics.Velocity.Y); physics.VelocityMinimum = new Vector2(ProjectileConstants.LEFTFIREINITIALXVELOCITY, physics.VelocityMinimum.Y); isExploded = false; this.factory = factory; }
public InvisiMario(Game1 game) { state = new InvisibleState(this); myGame = game; physics = new MarioGamePhysics(); physics.Velocity = Vector2.Zero; physics.Acceleration = Vector2.Zero; factory = new FireBallSpawner(game); isPressingDown = false; isDead = false; }
public Football(FootballSpawner spawner, Game1 game, bool throwingRight, bool isHostile, string footballType) { myGame = game; sprite = ProjectileSpriteFactory.CreateFootballSprite(); physics = new MarioGamePhysics(); InitializeFootballPhysics(footballType, throwingRight); isExploded = false; this.isHostile = isHostile; this.spawner = spawner; }
public PlayerBlob(Player owner, IGame game, IPhysics physics, IStateTracker stateTracker, Vector position, bool controlledByPlayer) : base(game, physics, stateTracker, position, game.Settings.MinPlayerBlobMass) { _physics = physics; Owner = owner; RecombineTicks = game.TickCount; ControlledByPlayer = controlledByPlayer; Mass = Game.Settings.MinPlayerBlobMass; MakeDynamic(); }
public Elevator(bool up, Game1 game) { this.up = up; myGame = game; elevatorSprite = LemmingSpriteFactory.CreateElevatorSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; physics.Velocity = Vector2.Zero; columnHeight = (LemmingSpriteConstants.ELEVATORDIMENSIONS.Y - 1); }
public GameObject(IInput input, IPhysics physics, IGraphics graphics) { _components = new List<Component>(); _input = input; _physics = physics; _graphics = graphics; _components.Add(_input as Component); _components.Add(_physics as Component); _components.Add(_graphics as Component); }
public PaddleBall(Game1 game) { myGame = game; isReleased = false; paddleBallState = new NormalPaddleBallState(this); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; physics.VelocityMaximum = ObjectPhysicsConstants.PADDLEBALLFASTMAXVELOCITY; physics.VelocityMinimum = ObjectPhysicsConstants.PADDLEBALLFASTMINVELOCITY; }
public Game(IRandom random, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository, IClock clock) { _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; _clock = clock; Random = random; _blobs = new List<Blob>(); Settings = new WorldSettings(); GameMode = new ClassicGameMode(this, physics, stateTracker, playerRepository); Stop(); }
protected Blob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position, float mass) { _physics = physics; Game = game; StateTracker = stateTracker; Position = position; Mass = mass; IsStatic = false; _isCreated = false; Id = BlobIdProvider.GetId(); }
public Paddle(Game1 game) { myGame = game; paddleBallSpawner = new PaddleBallSpawner(game); paddleSprite = MarioBrickBreakerSpriteFactory.CreateNormalPaddleSprite(); physics = new MarioGamePhysics(); physics.Acceleration = Vector2.Zero; physics.VelocityMaximum = ObjectPhysicsConstants.PADDLEBALLFASTMAXVELOCITY; physics.VelocityMinimum = ObjectPhysicsConstants.PADDLEBALLFASTMINVELOCITY; isDead = false; isMagnetized = false; }
/// <summary> /// Initializes a new instance of the Core class. /// </summary> public Core(IVisual visual) { this.visual = visual; physics = new Physics(this); FPS = defaultFPS; refreshTimer.Tick += (sender, e) => { if (visual.Visible) { lock (this) { visual.Refresh(); } } }; refreshTimer.Start(); physics.StartSimulation(FPS); }
public ScanningLaser(TestableGameObject obj, Box box, [GameObjectBoundary] Sphere sphere, IPhysics physics, IRigidBody body, ILayerMask layerMask) : base(obj) { this.physics = physics; this.sphere = sphere; body.useGravity = false; sphere.collider.enabled = false; box.Obj.transform.localScale = new UnityEngine.Vector3(10, 1, 1); sphere.body.isKinematic = true; body.AddTorque(new UnityEngine.Vector3(0, 5, 0), UnityEngine.ForceMode.Impulse); mask = 1 << layerMask.NameToLayer("Default"); }
public override void Update() { IPhysics marioPhysics = (IPhysics)mario; ICollidable marioCollision = (ICollidable)mario; if (sinkTimeOut > 0) { sinkTimeOut--; marioPhysics.Velocity = new Vector2(0, (float).75); mario.Update(); } else if (sinkTimeOut == 0) { mario.Location = new Vector2(location.X + 10, location.Y + 40); camera.CameraUpdate(); PlayerLevel.Instance.LevelUpdate(camera); mario.Location = new Vector2(location.X + 10, location.Y + 40); sinkTimeOut--; } else if (sinkTimeOut <= 0 && loadTimeOut > 0) { loadTimeOut--; } else if (loadTimeOut == 0) { SoundFactory.Instance.PlaySoundEffect("SOUND_PIPE"); loadTimeOut--; } else if (loadTimeOut <= 0 && riseTimeOut > 0) { riseTimeOut--; if (mario.Location.Y > (location.Y - marioCollision.Hitbox.Height)) { mario.Location = new Vector2(mario.Location.X, mario.Location.Y - 2); } } else { game.GameState = new NormalGameState(game, controllerList, camera); SoundFactory.Instance.PlayBackgroundMusic(); MediaPlayer.IsRepeating = true; } }
public override void Update() { if (levelTimeOut > 0) { IPhysics marioPhysics = (IPhysics)mario; ICollidable marioCollision = (ICollidable)mario; PlayerLevel.Instance.LevelUpdate(camera); PlayerLevel.Instance.BackgroundDestination = new Rectangle((int)location.X - 391, 0, 800, 480); if (mario.Location.Y <= (flagPole.Location.Y + flagPole.Hitbox.Height - marioCollision.Hitbox.Height) && !(mario.MovementState is MarioRightJumpState)) { marioPhysics.Velocity = new Vector2(0, 2); } if (flagPole.Flag.Location.Y < (flagPole.Location.Y + flagPole.Hitbox.Height - 25)) { flagPole.Flag.Location = new Vector2(flagPole.Flag.Location.X, flagPole.Flag.Location.Y + 2); } else if (flagPole.Flag.Location.Y >= (flagPole.Location.Y + flagPole.Hitbox.Height - 25) && mario.Location.Y >= (flagPole.Location.Y + flagPole.Hitbox.Height - marioCollision.Hitbox.Height)) { if (mario.Location.X < LEVEL_BARRIER) { mario.RunRight(); if (mario.MovementState is MarioFlagState) { SoundFactory.Instance.PlaySong("MUSIC_WORLD_CLEAR"); mario.Jump(); } } else { mario.Idle(); } } levelTimeOut--; } else { SuperPixelBrosGame.ResetLevel(); game.GameState = new MarioStartLevelState(game, controllerList, camera); SoundFactory.Instance.PlayBackgroundMusic(); } }
IEnumerator WaitForFinish(IPhysics phy, Transform t, float time) //waiting until the put down coroutine is over before applying physics properties { yield return(new WaitForSeconds(time)); GameObject theObj = GetHolding().GetObject(); if (theObj.CompareTag("Food")) { FoodPhysicsProperties(t); } else if (theObj.CompareTag("Tray") || theObj.CompareTag("Plate") || theObj.CompareTag("Surface")) { SurfaceFood(t); } else { phy.EnablePhysics(t); } SetInteract(null); }
/// <summary> /// The mutate across popup menu was clicked. /// </summary> /// <param name="sender">The sending object.</param> /// <param name="e">The event.</param> private void MenuMutateAcross_Click(object sender, RoutedEventArgs e) { int rows = Settings.Default.UniversePaneRows; int cols = Settings.Default.UniversePaneColumns; IPhysics sourcePhysics = _selectedCell.UniverseRunner.PhysicsRules; for (int currentRow = 0; currentRow < rows; currentRow++) { for (int currentCol = 0; currentCol < cols; currentCol++) { if (currentRow != _selectedRow || currentCol != _selectedCol) { _multiverse[currentRow][currentCol].UniverseRunner .Mutate(_rnd, sourcePhysics, 0.5, 0.2); _multiverse[currentRow][currentCol].UniverseRunner .Randomize(_rnd); } } } }
/// <summary> /// Pre-hook called by the Player Character when a player state is first added to the player. /// </summary> public override void OnStateAddedGeneral() { player = GetComponent <PlayerCharacter>(); physics = player.Physics; if (player.MovementSettings != null) { settings = player.MovementSettings; } else { settings = GetComponent <MovementSettings>(); } if (player.PowersSettings != null) { powersSettings = player.PowersSettings; } else { powersSettings = GetComponent <PowersSettings>(); } }
public void Execute() { firstEntity.Location = new Vector2(firstEntity.Location.X, firstEntity.Location.Y - collision.Overlap.Height); collision.FirstEntity.Hitbox = new Rectangle((int)firstEntity.Location.X, (int)firstEntity.Location.Y, collision.FirstEntity.Hitbox.Width, collision.FirstEntity.Hitbox.Height); IPhysics physicsFirstEntity = (IPhysics)firstEntity; physicsFirstEntity.Velocity = new Vector2(physicsFirstEntity.Velocity.X, 0); if (firstEntity is IMario player && (player.MovementState is MarioLeftJumpState || player.MovementState is MarioRightJumpState)) { ScoreKeeper.Instance.ResetMultiplier(); if (physicsFirstEntity.Velocity.X < 0) { player.MovementState = new MarioLeftRunState(player); } else if (physicsFirstEntity.Velocity.X > 0) { player.MovementState = new MarioRightRunState(player); } else { player.Idle(); } } }
/// <summary> /// Инициализирует класс GGame /// </summary> public GGame() { MScreen = new ManagementScreen(this); audio = new GAudio(); fileIO = new GFileIO(); graphics = new GGraphics(); input = new GInput(); physics = new GPhysics(this); camera = new GCamera(); systemParticles = new GSystemParticles(this); MScreen.SetCurrentScreen(GetStartScreen()); DoubleBuffered = true; Size = new Size(500, 700); Paint += GGame_Paint; MouseDown += GGame_MouseDown; MouseUp += GGame_MouseUp; MouseMove += GGame_MouseMove; DeltaTime = System.DateTime.Now.Millisecond; PrevDeltaTime = System.DateTime.Now.Millisecond; }
/// <summary> /// Инициализирует класс GGame /// </summary> public GGame(Activity context) : base(context) { DisplayMetrics displayMetrics = new DisplayMetrics(); context.Window.WindowManager.DefaultDisplay.GetMetrics(displayMetrics); width = displayMetrics.WidthPixels; height = displayMetrics.HeightPixels; MScreen = new ManagementScreen(this); audio = new GAudio(); fileIO = new GFileIO(); graphics = new GGraphics(); input = new GInput(); physics = new GPhysics(this); camera = new GCamera(); systemParticles = new GSystemParticles(this); MScreen.SetCurrentScreen(GetStartScreen()); DeltaTime = System.DateTime.Now.Millisecond; PrevDeltaTime = System.DateTime.Now.Millisecond; SetOnTouchListener(this); }
private void DummyInjectMethodPrivate(IPhysics physics) { PhysicsFromMethodPrivate = physics; }
/// <summary> /// Initializes a new instance of the <see cref="CanyonShooterGame"/> class. /// </summary> public CanyonShooterGame(string[] args) { Args = new Arguments(args); states = new GameStates(this, Components); config = new Config(); graphicsDeviceManager = new GraphicsDeviceManager(this); content = new ContentManager(Services); graphics = new Graphics(this, graphicsDeviceManager); this.Window.Title = " CanyonShooter"; Intercom.Game = this; #region Commandline Parameter Settings: #region Parameter: --setShaderModel if (Args["setShaderModel"] == "2") { graphics.ShaderModel3SupportedOverride = true; } #endregion #region Parameter: --debug if (Args["debug"] == "1") { debugMode = true; } #endregion #region Parameter: --multiThreaded // Physik Intialisierung /*if (Args["multiThreaded"] != null) * { * if(Args["multiThreaded"] == "1") * physics = new Physics(this, true); * else * { * physics = new Physics(this, false); * Components.Add(physics); * } * } * else*/// automatically set threading-mode { /*if (Environment.ProcessorCount > 1) * { * physics = new Physics(this, true); * } * else*/ { physics = new Physics(this, false); Components.Add(physics); } } #endregion #region Parameter: --testAudio // Test Audio Framework ******************************* if (Args["testAudio"] == "1") { TestAudioPlayback test1 = new TestAudioPlayback(); test1.SetUp(this); test1.TestMinigunPlayback(); test1.TearDown(); TestAudio3D test2 = new TestAudio3D(); test2.SetUp(this); test2.TestPlayback3D(); test2.TearDown(); } #endregion #endregion // Create sound system by M.Rodriguez sounds = new SoundSystem(this); // Set global volumes by M.Rodriguez sounds.EffectVolume = 1.0f; sounds.MusicVolume = 0.3f; // Initialisieren der einzelnen Komponenten: input = new Input(this); renderer = new Renderer(this, Components); effects = new EffectFactory(this); highscores = new Highscores(this); GraphicalConsole.GetSingleton(this).RegisterObjectProperty(graphics, "Graphics", "Fullscreen"); GraphicalConsole.GetSingleton(this).RegisterObjectProperty(renderer, "Renderer", "DrawCollisionShapes"); GraphicalConsole.GetSingleton(this).RegisterObjectFunction(Args, "Args", "ListParameters"); if (Args["enable3DMouse"] == "1") { hasSpaceMouse = true; device = new TDxInput.Device(); } states.SetStateStart(); // states.SetStateDebugMode(); }
public Bicycle(IPhysics physicsPlugin) : base(physicsPlugin) { Console.WriteLine("Bicycle ctor"); }
protected Agent(IPhysics physicsPlugin) { PluginPhysics = physicsPlugin; }
public Actor(World world, IPhysics physics) { this.world = world; this.physics = physics; }
public PlayerCommandFactory(IPhysics physics) { _physics = physics; }
public override void Ready() { transform = GetComponent<TransformComponent>(); physics = GetComponent<IPhysics>(); }
public EjectedMassBlob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position) : base(game, physics, stateTracker, position) { MakeDynamic(); }
/// <summary> /// Injection point for state dependencies. /// </summary> public void Inject(IPlayer player, IPhysics physics, MovementSettings settings) { this.player = player; this.physics = physics; this.settings = settings; }
public Destroyer(World world, IPhysics physics) : base(world, physics) { }
public Koopa(Vector2 location) { stateMachine = new KoopaStateMachine(location); Physics = new KoopaPhysics(this); }
public VirusSpawner(IGame game, IPhysics physics, IStateTracker stateTracker) : base(game, physics) { _stateTracker = stateTracker; }
public LockingPhysicsObject(IPhysics physics) { this.physics = physics; }
public GetViewPlayerCommand(IPhysics physics) { _physics = physics; }
public AdminCommandFactory(IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository) { _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; }
public void SetPhysicsl(IPhysics physics) { this.physics = physics; }
// Use this for initialization void Awake() { mEnemyPhysics = new EnemyPhysics<Enemy>(this); mEnemyPhysics.Collider = GetComponent<BoxCollider2D>(); mHPResumeTimer.SetIntervalTime(HPRESUME_TIME); mHPResumeTimer.SetIntervalEvent(ResumeHP); mRebornTimer.SetIntervalTime(REBORN_TIME); mRebornTimer.SetIntervalEvent(Reborn); }
public Bowser(Vector2 location, Game1 game) { stateMachine = new BowserStateMachine(location, game); Physics = new BowserPhysics(this); }
#pragma warning restore 649 public EngineMedium(IPhysics physics) { this.physics = physics; }
public void InitPhysics() { Physics = new CanyonPhysics(); Physics.Init(this); }
public void DummyInjectMethodPublic(IPhysics physics) { PhysicsFromMethodPublic = physics; }
public Goomba(Vector2 location) { stateMachine = new GoombaStateMachine(location); Physics = new GoombaPhysics(this); }
public FoodBlob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position) : base(game, physics, stateTracker, position, game.Settings.FoodMass) { MakeStatic(); }
public Star(Vector2 position) { sprite = ItemFactory.Instance.CreateStarItem(); Collided = false; ItemPhysics = new ItemPhysics(position); }
public RedKoopa(Koopa decoratedKoopa) { this.decoratedKoopa = decoratedKoopa; Physics = new KoopaPhysics(this); }