So in 2d games, there is a problem with orientation that doesn't appear in 3d games, specifically with regard to player facing direction and held objects. Normally, in a 2d game, a character just instantly flips left or right as soon as the player presses a direction key.
The problem comes when you want the player to be able to hold large objects in front of themselves. What happens to the held object when the player flips direction? In order for the object to maintain the same relative position, it has to instantly teleport to the opposite side of the player. This has a number of problems. For example, what should happen if the player was standing next to a wall and then faces into the wall?
Another option is to simply have the object stay in position. The problem is that if the character sprite changes direction like normal, it will look like the object is being held by thin air. So you need to create a completely separate set of dragging animations as well as complicating movement code slightly.
A third option is to just drop the object. But this sounds very annoying for the player.
2d orientation and held objects
How about making the direction-facing mouse controlled? Then when he smacks an item againt a wall just make him drop it or lock him in a certain position until he moves/faces away.
EDIT: Or make volume detecion of sorts. If the item is too close to said wall, make the PC grunt or shake his heard, preventing turning
EDIT2: Or make him have items held over his head when he faces a wall that cannot fit an item. But then what if the room is too small? Really tricky question you got there
EDIT: Or make volume detecion of sorts. If the item is too close to said wall, make the PC grunt or shake his heard, preventing turning
EDIT2: Or make him have items held over his head when he faces a wall that cannot fit an item. But then what if the room is too small? Really tricky question you got there
![:D](http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/biggrin.gif)
Disclaimer: Each my post is intended as an attempt of helping and/or brining some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure I mean no harm and do not intend to insult anyone, unless stated otherwise
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Sorry if I wasn't clear, but I'm talking about side view games, not topdown.
I trust exceptions about as far as I can throw them.
I too was talknig about sideview games. Those too have mouse controls and collision detection no? Look at the game Madness Combat for example. Or Contra (should it have mouse controls).
Disclaimer: Each my post is intended as an attempt of helping and/or brining some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure I mean no harm and do not intend to insult anyone, unless stated otherwise
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Sorry, I misunderstood your post.
I'm confused about how mouse controls help though. Because either way, orientation is still binary. Either you're facing left or you're facing right and controlling with the mouse doesn't change that.
I'm confused about how mouse controls help though. Because either way, orientation is still binary. Either you're facing left or you're facing right and controlling with the mouse doesn't change that.
I trust exceptions about as far as I can throw them.
As I understood it, the character has to carry the item in the hands, correct? So making those hands follow the mouse regardless of whether the player is facing left of right only leave you with the problem of arms looking broken when behind the player. The item will remain at the position the mouse is pointing at. No sudden changes occur and the program may smoothly detect whether the item is bumping into a wall or not
Disclaimer: Each my post is intended as an attempt of helping and/or brining some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure I mean no harm and do not intend to insult anyone, unless stated otherwise
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
You could make the character change movement direction immediately, but animate the apparent facing direction, moving the carried object to the new position?
You could make the character change movement direction immediately, but animate the apparent facing direction, moving the carried object to the new position?
Oh, right, guess it's kind of obvious right now. In conjunction with mous controls it would look nice. Make the character backpedal when the mouse is pointing to the direction opposite of movement.
Disclaimer: Each my post is intended as an attempt of helping and/or brining some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure I mean no harm and do not intend to insult anyone, unless stated otherwise
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
Homepage (Under Construction)
Check my profile for funny D&D/WH FRP quotes :)
you could just make the sprite of the object be on a different layer that just happens to work with the play char layer...
Also i believe this is in the wrong forum and should go inthe programming section where people can tell you exactly how to do it in code.
Also i believe this is in the wrong forum and should go inthe programming section where people can tell you exactly how to do it in code.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement