User interactivity

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
databandit
Posts: 32
Joined: Tue Dec 21, 2004 11:36 am

User interactivity

Post by databandit »

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-
Munku
Posts: 66
Joined: Tue Nov 30, 2004 4:04 pm

hmmmm

Post by Munku »

That depends on the game, what type?
Umm, don't look at me that way. I'M not the dead one here.

--The One True Marshmellow
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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.
16777216
Posts: 5
Joined: Sun Jan 09, 2005 2:36 am
Location: Melborne, Arkansas

Raytracing

Post by 16777216 »

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!
databandit
Posts: 32
Joined: Tue Dec 21, 2004 11:36 am

Re: hmmmm

Post by databandit »

Munku wrote:That depends on the game, what type?
it's an FPS
Munku
Posts: 66
Joined: Tue Nov 30, 2004 4:04 pm

Okay

Post by Munku »

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.
Umm, don't look at me that way. I'M not the dead one here.

--The One True Marshmellow
Post Reply