Tag Info

New answers tagged

2

This is more of a design decision, since objects are implicitly references in Java, so it really doesn't make much difference to be copying an extra reference. I'd suggest you just do whatever works first and then, if you feel you need to, start to optimise/change things and see if you get a better result. That's the best way to learn.


0

A spline function is used which produces curves based on discrete control points which you place; examples of curve generation functions that use control points are Catmull-Rom or Bezier. x is known, y is unknown; so use the spline function to get the y position of the curve for that x, then place your character at that x,y position.


1

What you probably want to do is create wrapper around SpriteBatch or create extension methods for SpriteBatch that apply the desired per-sprite inversion to each Draw call. Then you could just do: spriteBatch.DrawWorldSprite(texture, position, color); (You could even create an overload with a scaling parameter, that does appropriate multiplication so you ...


7

No, you don't have to use any specific toolset and you don't have to use any specific (physics) library either. It's just a question of convenience, since things like Box2D will provide you other benefits as well, e.g. being able to do collision, physics simulation etc. If you're not using tiles, you'll most likely want to write your own custom editor. As ...


0

To #2: yes, you are doing it wrong. You are trying to change the framework's 2d coordinate system, with its origin at top left (this follows texture coordinates convention in directX). You are allowed to make that change; the trade-off is that you have to do it all the time, with every draw. Since that's what you seem to dislike, you might consider the ...


0

If your maps are small, which the one above seems so, using a list of blockCollidable = true items. Then when the character is moving have an foreach(Block currentBlock in Collidables) { if (player.X + tileWidth > currentBlock.X && player.X < currentBlock.X + tileWidth) { if (player.Y...) { //Collision Code } } } ...


5

Make sure that there is a visual cue that the player is currently not in control. When it is a non-interactive cutscene, you could remove the GUI during the cutscene and bring it back as soon as the player is in control again. When the users control is impaired (but not completely disabled) during normal gameplay, for example because their character is ...


1

With only the given information I would assume one of a few scenarios is happening here: Something very mysterious because you provided very little information Your player is on the enemy layer and subsequently the ray immediately hits the player You are not setting up your EnemyLayer variable correctly. To filter a Raycast based on layer you need to set ...


-1

There is an "fixed angle" option on Rigidbody2D component,enabling that works



Top 50 recent answers are included