Documentation

Tutorial: Basic Entity

Step 1

Using the Previous Tutorial as the starting point, switch over to Entity Editor and click the Add button

Step 2

Now you can open up firstentity.mps

Step 3


/* Initialise Two Fixed valiables to hold position */
new Fixed:x = 0.00;
new Fixed:y = 0.00;
new Fixed:z = 0.00;

/* We want to get the position on entity start up, so we use the Init function */
public Init(...)
{
    /* We want to store, position for current entity to x, y variables. A empty sting access current entity, other wise you could use a entity ID to get it's position  */
    EntityGetPosition(x, y, z);
    /* You can get the Display Object store on the map by using EntityGetSetting, more on that on next tutorial */
}

main()
{
    /* Draw object to screen each frame frame */
    GraphicsDraw("tutorial-sheet1.png:2", SPRITE, fround(x), fround(y), fround(z), 0, 0, WHITE ); /* See Scripting Interface for info on Draw Function */
}

This is a simple entity to get the entity position and to draw to the screen

Step 4

Now with the Entity created, you can now attach it to a display object on the map. Open up the Object's Advance Settings and check the entity check box, then select firstentity.mps


Comments

Comming Soon