Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

135 Neutral

About locoflop

  • Rank
  1. Hello, in this OpenTK application why can you get the perfect scale with Math.PI? http://www.opentk.com/node/2294   time = (time >= Math.PI) ? 0.0 : time + e.Time; variableScale = (float)(Math.Sin(time)); I know that Sin works best for 0..360 circle degrees range, but Math.PI related to time is strange.   If you have any references about and links to share please post here. Thanks.  
  2. locoflop

    Understanding Tiled TMX gids.

    Thanks a lot, this snippet helped me to clarify things a bit. Clever approach to iterate through all of the tilesets.
  3. locoflop

    xna dead. now what?

    Here is my favourites (random order): SharpDX: If you want DirectX support currently better for Windows PC, perhaps in the future also for tablets/mobile. There was an ongoing vote to convice Microsoft to enable some functionality that could allow developers to support mobile/tablet devices running Windows 8, but who knows what happened. OpenTK: Very good for cross platform (Windows/Mac/Linux), unfortunately support is halted so you must use the repo of Andy Korth at github in order to get the latest version. Also if you are interested in MonoTouch and MonoDroid chances are that you can reuse most of your code. Pencil.Gaming: An evolution of OpenTK, more clean and practial. It looks like a polished version of OpenTK that is tied to GLFW3 instead for Window management. Unity: You will have to use it to believe. For me personally, let me do other creative things in game rather than system development. It's a matter of where exactly is your interest.
  4. Have any one looked at the Tiled format?   One thing that I try to understand is if a layer contains tiles from two tilesets, then how you can understand which tile originates from a specific tileset.   For example: f tileset A consists of a region of numbers 1 to 19 then it will have first GID 1. If tileset B consists of a region of numbers 20 to 29 then it will have first GID 20. And so on...   If in a Layer I have these tiles: 1, 10, 2, 20, 15, 25 Then they match this pattern of tilesets: A, A, A, B, A, B   What I really don't understand is how you can estimate in programming how this happens. I have looked at various TMX parsers but I can't figure out how exactly they achieve that.
  5. Hello, I have a piece of code where I would like to move the player up and down with touch input. If the touch is made just above the player position then player moves up and the same goes for opposite direction. The problem I have is that when the position of player is the same as the touch position then I have a nasty filckering (player moves up for one moment then moves down, and keep going as long as I have the pressed event going on). I tried to eliminate the flickering but I can't figure out what is going on. Any ideas or a better preffered way will be much welcomed. public override void Update(GameTime gameTime) { #region Input NinjaGame.Instance.TouchCollection = TouchPanel.GetState(); foreach (TouchLocation tl in NinjaGame.Instance.TouchCollection) { if (tl.State == TouchLocationState.Pressed || tl.State == TouchLocationState.Moved) { float playerPosHalfHeight = this.Position.Y + (this.Texture.Height/2); // Something fishy is going on here... if (tl.Position.Y >= playerPosHalfHeight) this.Velocity = new Vector2(0f, 0.25f); if (tl.Position.Y < playerPosHalfHeight) this.Velocity = new Vector2(0f, -0.25f); } if (tl.State == TouchLocationState.Released) { this.Velocity = new Vector2(0f, 0f); } } #endregion base.Update(gameTime); /* In other words... float delta = (float)gameTime.ElapsedGameTime.Milliseconds; Position += new Vector2(Velocity.X * delta, Velocity.Y * delta); */ #region Screen bounds check (top / bottom) if (this.Position.Y + this.Texture.Height > NinjaGame.Instance.GraphicsDevice.Viewport.Height) this.Position = new Vector2(this.Position.X, NinjaGame.Instance.GraphicsDevice.Viewport.Height - this.Texture.Height); if (this.Position.Y < 0f) this.Position = new Vector2(this.Position.X, 0f); #endregion } Thanks, happy coding.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!