Jump to content

Creating a Player


Calimaw
 Share

Recommended Posts

I need a bit of help on how to create a player using GameLib and LEO.

#include "gamelib.h"

int main()
{
       Game game;

       Engine engine;

       engine.Create();
       game.Initialize( 1024, 768);
	Engine::SetAbstractPath( "D:/Program Files/LWSDK" );
       Engine::SetFilters( 4, 1 );
       Collisions::Set();

	game.scene.LoadMap( "abstract::murk01.sbx" );
	Camera cam( CREATENOW );


       // Game loop
       while( !Keyboard::I****() && !Engine::IsTerminated() )
       {
           if( !Engine::IsSuspended() ) // We are not in focus!
           {

               // Render
               game.scene.Update();
               game.scene.Render();

               // Send to screen
               Engine::Flip(0);
           }
       }

       // Done
       return engine.Free();
}

Link to comment
Share on other sites

There is the Power Tutorial to begin.

 

4) Adding the player

After loading the map write this line:

 

game.scene.SetCurrentPlayer("whateveryouwanttoname");

 

Then you can call the following in the game loop after the Update call:

 

game.MouseLook(game.scene.cam);
game.KeyboardMove();
game.PositionPlayerModel();
game.PositionCamera();

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...