Sign in to follow this  
twety94Gmail

How to handle actions in game

Recommended Posts

twety94Gmail    115
Hello.
I am curious, how should i handle my actions in game. I am making a 2D Rpg.
I am not sure what to search as tutorial vise.
Basically i have a "Player" and if he uses lets say button "a" (which is attack) i will run animation swing sword, but my problem starts here
how do i check that something is supposed to get hit? collision detection?.
And interacting with NPC. W(is talk button / interact) i wanna make it realistic and he should be facing the NPC and be close, only then he can start the conversation, again should i detect if hes "calculate where the NPC facing position is" and check for that, or how do people usually make it.
any help is appreciated.

RPG = Role Playing Game
NPC = Non Player Character Edited by twety94Gmail

Share this post


Link to post
Share on other sites
Narf the Mouse    322
The first is a design decision, but usually 2D RPGs just roll dice for hit/miss.

The second is a matter of vector math; specifically, dot product. Find a good 2D math book and read it; that'll tell you far more than you can get on a forum.

Share this post


Link to post
Share on other sites
Tw3tye    117
[quote name='Narf the Mouse' timestamp='1339373534' post='4948031']
The first is a design decision, but usually 2D RPGs just roll dice for hit/miss.

The second is a matter of vector math; specifically, dot product. Find a good 2D math book and read it; that'll tell you far more than you can get on a forum.
[/quote]

Only shame is that my native language is not englis, so i don't know what vector means or etc it will be some hard work.
Anyway thank you for replay.

Share this post


Link to post
Share on other sites
It basically comes down to a design decision, maybe you want to have a combat system where the player can swing his weapon anywhere in the world, or maybe you only want the player to attack when he is next to an enemy. You could have a collision box that covers the sharp edges on a sword, then you just check if something collides with it.
It would be easier to help if you could tell us what design you are thinking about.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this