Hi,
I'm fairly new to gameplay programming. Can someone please some give me some ideas as to how to incorporate user interactivity in my game?
For example, when I get close to a door and press -space- it should open . . . how do I go about doing this?
Thanks,
-zubair-
User interactivity
I would make a class for all 3dobjects in the world. If the object is capable to be manipulated by the user, I would set a flag for that object. When the user presses a certain key, I would raytrace a line from the players current position forward. If the line intersects an object which can be manipulated by that key, then I would perform an action, based on that key.
Raytracing
actualy it would be "raycasting" because you do not count any reflections (you do that for bouncing a projectile "n" times)
Um, uh, yea... sure!
-
- Posts: 32
- Joined: Tue Dec 21, 2004 11:36 am
Re: hmmmm
it's an FPSMunku wrote:That depends on the game, what type?
Okay
Okay, first of all you can make a class to handle all of the graphics AND/OR events (such as the kb, mouse, etc). You should also have a Player class that handles everything about them (Name, flags, etc).
For the player class you can have a base class that contains all the normal things and derive other classes from it like:
CBasePlayer
|
/ \
/ \
/ \
CPlayer \
CNPC
This can also work with objects (guns, knifes, medpacks), etc.
Hope this helps a bit.
For the player class you can have a base class that contains all the normal things and derive other classes from it like:
CBasePlayer
|
/ \
/ \
/ \
CPlayer \
CNPC
This can also work with objects (guns, knifes, medpacks), etc.
Hope this helps a bit.
Umm, don't look at me that way. I'M not the dead one here.
--The One True Marshmellow
--The One True Marshmellow