tutorial 4 missing code

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
squareball
Posts: 11
Joined: Sat Mar 05, 2005 3:41 am

tutorial 4 missing code

Post by squareball »

I was working on the 4th tutorial, using the webpage format, and noticed some code was missing. The part that gave it away was that the class was never closed before the main function was started.

Code: Select all

class MyEventReceiver : public IEventReceiver{public:	virtual bool OnEvent(SEvent event)	{ 
 

If the key 'W' or 'S' was left up, we get the position of the scene node, and modify the Y coordinate a little bit. So if you press 'W', the node moves up, and if you press 'S' it moves down.

-->if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT&&			!event.KeyInput.PressedDown){		switch(event.KeyInput.Key)		{		case KEY_KEY_W:		case KEY_KEY_S:			{				core::vector3df v = node->getPosition();				v.Y += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;				node->setPosition(v);			}			return true;		}}<--
 

The event receiver for moving a scene node is ready. So lets just create an Irrlicht Device and the scene node we want to move. We also create some other additional scene nodes, to show that there are also some different possibilities to move and animate scene nodes.

int main()
 
The -->part<-- is the trouble area.
On the plus side, though, it's correct in the code that's supplied. Just thought I'd mention this so it can get fixed.
Post Reply