![]() if timer exist and is stopped then restarts (unless you give attributes delay or loops then it is reseted).Basically, if you don't give all parameters the timer uses default values, or if the timer already exists then it is resetted, or started if it is stopped with Game.StopTimer(). This function is used to create a timer, or start a stopped timer. Timers StartTimer(Name,Delay=100,Loops=0) The code of the script can be included between and in the level file. However, if you choose to include the script in an xml file, symbol must be replaced by < and >.For example, to make your level require X-Moto version 0.2.0, add this line to your level:Īll the code of the script is written in Lua. If you use one of these functions, please put this information in the level. Some functions require a minimum X-Moto version to work. A zone is an invisible part of the level that can execute actions when the player is inside. ![]() It includes a block called Block0 which is a square, a strawberry called Strawberry0 and a zone called Zone0. This level can be made easily with the xmoto level editor. The script examples on this page will use this basic level file: The first player has the number 0, the second the number 1. Since 0.3.0, xmoto supports multiplayers in the script, a player is defined by an index. A block is composed of vertices which link together to draw polygons. Moreover, it includes block and sprite definitions. It includes somes properties like the name of the level, description, author, date, etc. To write a script, you must know a little about a level file. ![]() A script is written in the Lua language and can be included in a level file.ĭocumentation about Lua can be found here : You can change physic settings, move objects, modify game logic, etc. Scripting allows a level to become dynamic. 4.51 SetPhysicsBlockSelfRotation (block, torque, startTime, endTime).4.49 AddForceToPlayer(forceX, forceY, startTime, endTime, player).4.32 SetDynamicBlockTranslation(block, fX, fY, period, startTime, endTime).4.31 SetDynamicBlockSelfRotation(block, period, startTime, endTime).4.30 SetDynamicBlockRotation(block, initAngle, radius, period, startTime, endTime).4.28 SetDynamicEntityTranslation(entity, fX, fY, period, startTime, endTime).4.27 SetDynamicEntitySelfRotation(entity, period, startTime, endTime).4.26 SetDynamicEntityRotation(entity, initAngle, radius, period, startTime, endTime).4.9 SetAPlayerPosition(x, y, bRight, player).3.13 OnWheel1TouchsBy(status, player), OnWheel2TouchsBy(status, player).3.12 OnWheel1Touchs(status), OnWheel2Touchs(status).3.11 OnSomersaultBy(bClockWise, player).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |