From 80c5a31c8a7c5cdba01f576e115890eae589a5ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:08:05 +0000 Subject: [PATCH] deploy: a6455236d6d19694307716f89d5c6658559a0519 --- 404.html | 2 +- assets/js/4315fc58.0da20a9f.js | 1 + assets/js/4315fc58.2e92c32b.js | 1 - ...n.87e4fe11.js => runtime~main.0f9c0a2f.js} | 2 +- blog/archive/index.html | 2 +- blog/first-blog-post/index.html | 2 +- blog/index.html | 2 +- blog/tags/first/index.html | 2 +- blog/tags/index.html | 2 +- docs/APIs/Fmath/index.html | 2 +- docs/APIs/PewPew/index.html | 84 ++++++++++++++++++- docs/APIs/standard-libraries/index.html | 2 +- docs/APIs/types/index.html | 2 +- .../manifest-files/index.html | 2 +- docs/File Information/mesh-files/index.html | 2 +- docs/File Information/sound-files/index.html | 2 +- docs/Guides/Lua/advanced/index.html | 2 +- docs/Guides/Lua/beginner/index.html | 2 +- docs/Guides/Lua/intermediate/index.html | 2 +- docs/Guides/Other/fps-animation/index.html | 2 +- docs/Other/game-limits/index.html | 2 +- docs/Other/level-design-principles/index.html | 2 +- docs/home/index.html | 2 +- index.html | 2 +- search-index.json | 2 +- search/index.html | 2 +- 26 files changed, 104 insertions(+), 28 deletions(-) create mode 100644 assets/js/4315fc58.0da20a9f.js delete mode 100644 assets/js/4315fc58.2e92c32b.js rename assets/js/{runtime~main.87e4fe11.js => runtime~main.0f9c0a2f.js} (97%) diff --git a/404.html b/404.html index 8b080ae..d1d15e7 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@
print()
",id:"print",level:3},{value:"print_debug_info()
",id:"print_debug_info",level:3},{value:"set_level_size()
",id:"set_level_size",level:3},{value:"add_wall()
",id:"add_wall",level:3},{value:"remove_wall()
",id:"remove_wall",level:3},{value:"add_update_callback()
",id:"add_update_callback",level:3},{value:"get_number_of_players()
",id:"get_number_of_players",level:3},{value:"increase_score_of_player()
",id:"increase_score_of_player",level:3},{value:"increase_score_streak_of_player()
",id:"increase_score_streak_of_player",level:3},{value:"get_score_streak_level()
",id:"get_score_streak_level",level:3},{value:"stop_game()
",id:"stop_game",level:3},{value:"get_player_inputs()
",id:"get_player_inputs",level:3},{value:"get_score_of_player()
",id:"get_score_of_player",level:3},{value:"configure_player()
",id:"configure_player",level:3},{value:"configure_player_hud()
",id:"configure_player_hud",level:3},{value:"get_player_configuration()
",id:"get_player_configuration",level:3},{value:"configure_player_ship_weapon()
",id:"configure_player_ship_weapon",level:3},{value:"configure_player_ship_wall_trail()
",id:"configure_player_ship_wall_trail",level:3},{value:"configure_player_ship()
",id:"configure_player_ship",level:3},{value:"add_damage_to_player_ship()
",id:"add_damage_to_player_ship",level:3},{value:"add_arrow_to_player_ship()
",id:"add_arrow_to_player_ship",level:3},{value:"remove_arrow_from_player_ship()
",id:"remove_arrow_from_player_ship",level:3},{value:"make_player_ship_transparent()
",id:"make_player_ship_transparent",level:3},{value:"set_player_ship_speed()
",id:"set_player_ship_speed",level:3},{value:"get_all_entities()
",id:"get_all_entities",level:3},{value:"get_entities_colliding_with_disk()
",id:"get_entities_colliding_with_disk",level:3},{value:"get_entity_count()
",id:"get_entity_count",level:3},{value:"get_entity_type()
",id:"get_entity_type",level:3},{value:"play_ambient_sound()
",id:"play_ambient_sound",level:3},{value:"play_sound()
",id:"play_sound",level:3},{value:"create_explosion()
",id:"create_explosion",level:3},{value:"add_particle()
",id:"add_particle",level:3},{value:"new_asteroid()
",id:"new_asteroid",level:3},{value:"new_asteroid_with_size()
",id:"new_asteroid_with_size",level:3},{value:"new_baf()
",id:"new_baf",level:3},{value:"new_baf_red()
",id:"new_baf_red",level:3},{value:"new_baf_blue()
",id:"new_baf_blue",level:3},{value:"new_bomb()
",id:"new_bomb",level:3},{value:"new_bonus()
",id:"new_bonus",level:3},{value:"new_crowder()
",id:"new_crowder",level:3},{value:"new_floating_message()
",id:"new_floating_message",level:3},{value:"new_customizable_entity()
",id:"new_customizable_entity",level:3},{value:"new_inertiac()
",id:"new_inertiac",level:3},{value:"new_kamikaze()
",id:"new_kamikaze",level:3},{value:"new_mothership()
",id:"new_mothership",level:3},{value:"new_mothership_bullet()
",id:"new_mothership_bullet",level:3},{value:"new_pointonium()
",id:"new_pointonium",level:3},{value:"new_plasma_field()
",id:"new_plasma_field",level:3},{value:"new_player_ship()
",id:"new_player_ship",level:3},{value:"new_player_bullet()
",id:"new_player_bullet",level:3},{value:"new_rolling_cube()
",id:"new_rolling_cube",level:3},{value:"new_rolling_sphere()
",id:"new_rolling_sphere",level:3},{value:"new_spiny()
",id:"new_spiny",level:3},{value:"new_super_mothership()
",id:"new_super_mothership",level:3},{value:"new_wary()
",id:"new_wary",level:3},{value:"new_ufo()
",id:"new_ufo",level:3},{value:"rolling_cube_set_enable_collisions_with_walls()
",id:"rolling_cube_set_enable_collisions_with_walls",level:3},{value:"ufo_set_enable_collisions_with_walls()
",id:"ufo_set_enable_collisions_with_walls",level:3},{value:"entity_get_position()
",id:"entity_get_position",level:3},{value:"entity_get_is_alive()
",id:"entity_get_is_alive",level:3},{value:"entity_get_is_started_to_be_destroyed()
",id:"entity_get_is_started_to_be_destroyed",level:3},{value:"entity_set_position()
",id:"entity_set_position",level:3},{value:"entity_set_radius()
",id:"entity_set_radius",level:3},{value:"entity_set_update_callback()
",id:"entity_set_update_callback",level:3},{value:"entity_destroy()
",id:"entity_destroy",level:3},{value:"entity_react_to_weapon()
",id:"entity_react_to_weapon",level:3},{value:"entity_add_mace()
",id:"entity_add_mace",level:3},{value:"customizable_entity_set_position_interpolation()
",id:"customizable_entity_set_position_interpolation",level:3},{value:"customizable_entity_set_angle_interpolation()
",id:"customizable_entity_set_angle_interpolation",level:3},{value:"customizable_entity_set_mesh()
",id:"customizable_entity_set_mesh",level:3},{value:"customizable_entity_set_flipping_meshes()
",id:"customizable_entity_set_flipping_meshes",level:3},{value:"customizable_entity_set_mesh_color()
",id:"customizable_entity_set_mesh_color",level:3},{value:"customizable_entity_set_string()
",id:"customizable_entity_set_string",level:3},{value:"customizable_entity_set_mesh_xyz()
",id:"customizable_entity_set_mesh_xyz",level:3},{value:"customizable_entity_set_mesh_z()
",id:"customizable_entity_set_mesh_z",level:3},{value:"customizable_entity_set_mesh_scale()
",id:"customizable_entity_set_mesh_scale",level:3},{value:"customizable_entity_set_mesh_xyz_scale()
",id:"customizable_entity_set_mesh_xyz_scale",level:3},{value:"customizable_entity_set_mesh_angle()
",id:"customizable_entity_set_mesh_angle",level:3},{value:"customizable_entity_skip_mesh_attributes_interpolation()
",id:"customizable_entity_skip_mesh_attributes_interpolation",level:3},{value:"customizable_entity_configure_music_response()
",id:"customizable_entity_configure_music_response",level:3},{value:"customizable_entity_add_rotation_to_mesh()
",id:"customizable_entity_add_rotation_to_mesh",level:3},{value:"customizable_entity_set_visibility_radius()
",id:"customizable_entity_set_visibility_radius",level:3},{value:"customizable_entity_configure_wall_collision()
",id:"customizable_entity_configure_wall_collision",level:3},{value:"customizable_entity_set_player_collision_callback()
",id:"customizable_entity_set_player_collision_callback",level:3},{value:"customizable_entity_set_weapon_collision_callback()
",id:"customizable_entity_set_weapon_collision_callback",level:3},{value:"customizable_entity_start_spawning()
",id:"customizable_entity_start_spawning",level:3},{value:"customizable_entity_start_exploding()
",id:"customizable_entity_start_exploding",level:3},{value:"customizable_entity_set_tag()
",id:"customizable_entity_set_tag",level:3},{value:"customizable_entity_get_tag()
",id:"customizable_entity_get_tag",level:3}];function r(e){const n={blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"pewpew-library",children:"pewpew library"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"pewpew"})," library contains all the functions for configuring levels and managing entities."]}),"\n",(0,t.jsx)(n.h2,{id:"enums",children:"Enums"}),"\n",(0,t.jsx)(n.h3,{id:"entitytype",children:"EntityType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"ASTEROID"}),"\n",(0,t.jsx)(n.li,{children:"BAF"}),"\n",(0,t.jsx)(n.li,{children:"INERTIAC"}),"\n",(0,t.jsx)(n.li,{children:"MOTHERSHIP"}),"\n",(0,t.jsx)(n.li,{children:"MOTHERSHIP_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"ROLLING_CUBE"}),"\n",(0,t.jsx)(n.li,{children:"ROLLING_SPHERE"}),"\n",(0,t.jsx)(n.li,{children:"UFO"}),"\n",(0,t.jsx)(n.li,{children:"WARY"}),"\n",(0,t.jsx)(n.li,{children:"CROWDER"}),"\n",(0,t.jsx)(n.li,{children:"CUSTOMIZABLE_ENTITY"}),"\n",(0,t.jsx)(n.li,{children:"SHIP"}),"\n",(0,t.jsx)(n.li,{children:"BOMB"}),"\n",(0,t.jsx)(n.li,{children:"BAF_BLUE"}),"\n",(0,t.jsx)(n.li,{children:"BAF_RED"}),"\n",(0,t.jsx)(n.li,{children:"WARY_MISSILE"}),"\n",(0,t.jsx)(n.li,{children:"UFO_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"SPINY"}),"\n",(0,t.jsx)(n.li,{children:"SUPER_MOTHERSHIP"}),"\n",(0,t.jsx)(n.li,{children:"PLAYER_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"BOMB_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"PLAYER_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"BONUS"}),"\n",(0,t.jsx)(n.li,{children:"FLOATING_MESSAGE"}),"\n",(0,t.jsx)(n.li,{children:"POINTONIUM"}),"\n",(0,t.jsx)(n.li,{children:"KAMIKAZE"}),"\n",(0,t.jsx)(n.li,{children:"BONUS_IMPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"MACE"}),"\n",(0,t.jsx)(n.li,{children:"PLASMA_FIELD"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"mothershiptype",children:"MothershipType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"THREE_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"FOUR_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"FIVE_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"SIX_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"SEVEN_CORNERS"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"cannontype",children:"CannonType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"SINGLE"}),"\n",(0,t.jsx)(n.li,{children:"TIC_TOC"}),"\n",(0,t.jsx)(n.li,{children:"DOUBLE"}),"\n",(0,t.jsx)(n.li,{children:"TRIPLE"}),"\n",(0,t.jsx)(n.li,{children:"FOUR_DIRECTIONS"}),"\n",(0,t.jsx)(n.li,{children:"DOUBLE_SWIPE"}),"\n",(0,t.jsx)(n.li,{children:"HEMISPHERE"}),"\n",(0,t.jsx)(n.li,{children:"SHOTGUN"}),"\n",(0,t.jsx)(n.li,{children:"LASER"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"cannonfrequency",children:"CannonFrequency"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"FREQ_30"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_15"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_10"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_7_5"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_6"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_5"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_3"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_2"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_1"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"bombtype",children:"BombType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"FREEZE"}),"\n",(0,t.jsx)(n.li,{children:"REPULSIVE"}),"\n",(0,t.jsx)(n.li,{children:"ATOMIZE"}),"\n",(0,t.jsx)(n.li,{children:"SMALL_ATOMIZE"}),"\n",(0,t.jsx)(n.li,{children:"SMALL_FREEZE"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"macetype",children:"MaceType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"DAMAGE_PLAYERS"}),"\n",(0,t.jsx)(n.li,{children:"DAMAGE_ENTITIES"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"bonustype",children:"BonusType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"REINSTANTIATION"}),"\n",(0,t.jsx)(n.li,{children:"SHIELD"}),"\n",(0,t.jsx)(n.li,{children:"SPEED"}),"\n",(0,t.jsx)(n.li,{children:"WEAPON"}),"\n",(0,t.jsx)(n.li,{children:"MACE"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"weapontype",children:"WeaponType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"BULLET"}),"\n",(0,t.jsx)(n.li,{children:"FREEZE_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"REPULSIVE_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"ATOMIZE_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"PLASMA_FIELD"}),"\n",(0,t.jsx)(n.li,{children:"WALL_TRAIL_LASSO"}),"\n",(0,t.jsx)(n.li,{children:"MACE"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"asteroidsize",children:"AsteroidSize"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"SMALL"}),"\n",(0,t.jsx)(n.li,{children:"MEDIUM"}),"\n",(0,t.jsx)(n.li,{children:"LARGE"}),"\n",(0,t.jsx)(n.li,{children:"VERY_LARGE"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,t.jsx)(n.h3,{id:"print",children:(0,t.jsx)(n.code,{children:"print()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.print(str: string)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Prints ",(0,t.jsx)(n.code,{children:"str"})," in the console for debugging."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local some_number = 42\npewpew.print("the value of some_number is: " .. some_number)\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"print_debug_info",children:(0,t.jsx)(n.code,{children:"print_debug_info()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.print_debug_info()\n"})}),"\n",(0,t.jsx)(n.p,{children:"Prints debug info: the number of entities created and the amount of memory used by the script."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.print_debug_info()\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_level_size",children:(0,t.jsx)(n.code,{children:"set_level_size()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.set_level_size(\n width: FixedPoint,\n height: FixedPoint\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Sets the level's size. Implicetely adds walls to make sure that entities can not go outside of the level's boundaries. ",(0,t.jsx)(n.code,{children:"width"})," and ",(0,t.jsx)(n.code,{children:"height"})," are clamped to the range ]0fx, 6000fx]. If this function is not called, the level size is (10fx, 10fx), which is uselessly small for most cases."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local width = 300fx\nlocal height = 200fx\npewpew.set_level_size(width, height)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_wall",children:(0,t.jsx)(n.code,{children:"add_wall()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_wall(\n start_x: FixedPoint,\n start_y: FixedPoint,\n end_x: FixedPoint,\n end_y: FixedPoint\n): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Adds a wall to the level from (",(0,t.jsx)(n.code,{children:"start_x"}),",",(0,t.jsx)(n.code,{children:"start_y"}),") to (",(0,t.jsx)(n.code,{children:"end_x"}),",",(0,t.jsx)(n.code,{children:"end_y"}),"), and returns its wall ID. A maximum of 200 walls can be added to a level."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.add_wall(100fx, 100fx, 200fx, 200fx)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"remove_wall",children:(0,t.jsx)(n.code,{children:"remove_wall()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.remove_wall(wall_id: int)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Remove the wall with the given ",(0,t.jsx)(n.code,{children:"wall_id"}),"."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local wall_id = pewpew.add_wall(100fx, 100fx, 200fx, 200fx)\n-- Later, when the wall needs to be removed:\npewpew.remove_wall(wall_id)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_update_callback",children:(0,t.jsx)(n.code,{children:"add_update_callback()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_update_callback(update_callback: function)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Adds a callback that will be updated at each game tick."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local tick_count = 0\npewpew.add_update_callback(function()\n pewpew.print("this is tick " .. tick_count)\n tick_count = tick_count + 1\nend)\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_number_of_players",children:(0,t.jsx)(n.code,{children:"get_number_of_players()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_number_of_players(): int\n"})}),"\n",(0,t.jsx)(n.p,{children:"Returns the number of players in the game."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"increase_score_of_player",children:(0,t.jsx)(n.code,{children:"increase_score_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.increase_score_of_player(\n player_index: int,\n delta: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Increases the score of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"})," by an amount of ",(0,t.jsx)(n.code,{children:"delta"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. Note that ",(0,t.jsx)(n.code,{children:"delta"})," can be negative."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"increase_score_streak_of_player",children:(0,t.jsx)(n.code,{children:"increase_score_streak_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.increase_score_streak_of_player(\n player_index: int,\n delta: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Increases the score streak counter of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"})," by an amount of ",(0,t.jsx)(n.code,{children:"delta"}),". This counter is used to determine at which level of score streak the player is at. In turn, the score streak level is used to determine how much pointonium is given. Typically the score streak counter should be increased when an enemy is destroyed with the same score that the enemy provide. ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. Note that ",(0,t.jsx)(n.code,{children:"delta"})," can be negative."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_score_streak_level",children:(0,t.jsx)(n.code,{children:"get_score_streak_level()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_score_streak_level(player_index: int): int\n"})}),"\n",(0,t.jsx)(n.p,{children:"Returns a number between 0 and 3. 0 is the lowest score streak (no pointonium is given), while 3 is the highest (3 pointoniums is usually given)"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"stop_game",children:(0,t.jsx)(n.code,{children:"stop_game()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.stop_game()\n"})}),"\n",(0,t.jsx)(n.p,{children:"Ends the current game."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_player_inputs",children:(0,t.jsx)(n.code,{children:"get_player_inputs()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_player_inputs(player_index: int): FixedPoint, FixedPoint, FixedPoint, FixedPoint\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns the inputs of the player at the specified ",(0,t.jsx)(n.code,{children:"index"}),". The return values are in order: the movement joystick's angle (between 0 and 2pi), the movement joystick's distance (between 0 and 1), the shoot joystick's angle (between 0 and 2pi), and the shoot joystick's distance (between 0 and 1)."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local move_angle, move_distance, shoot_angle, shoot_distance = pewpew.get_player_inputs(0)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_score_of_player",children:(0,t.jsx)(n.code,{children:"get_score_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_score_of_player(player_index: int): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns the score of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player",children:(0,t.jsx)(n.code,{children:"configure_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player(\n player_index: int,\n configuration: table {\n has_lost: bool,\n shield: int,\n camera_x_override: FixedPoint,\n camera_y_override: FixedPoint,\n camera_distance: FixedPoint,\n camera_rotation_x_axis: FixedPoint,\n move_joystick_color: int,\n shoot_joystick_color: int\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. A ",(0,t.jsx)(n.code,{children:"camera_distance"})," less than 0fx makes the camera move away from the ship. ",(0,t.jsx)(n.code,{children:"camera_rotation_x_axis"})," is in radian and rotates along the X axis.\nTo temporarily override the XY position of the camera, set ",(0,t.jsx)(n.strong,{children:"both"})," ",(0,t.jsx)(n.code,{children:"camera_x_override"})," and ",(0,t.jsx)(n.code,{children:"camera_y_override"}),"; this will make the camera be interpolated from wherever it was, to that new position."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.configure_player(0, {shield = 3, camera_distance = 50fx, move_joystick_color = 0xffff00ff})\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_hud",children:(0,t.jsx)(n.code,{children:"configure_player_hud()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_hud(\n player_index: int,\n configuration: table {\n top_left_line: string\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the player's HUD.",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'pewpew.configure_player_hud(0, {top_left_line = "Hello World"})\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_player_configuration",children:(0,t.jsx)(n.code,{children:"get_player_configuration()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_player_configuration(player_index: int): table {\n shield: int,\n has_lost: bool\n }\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns a map containing the configuration of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),"."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local shield = pewpew.get_player_configuration(0).shield\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_ship_weapon",children:(0,t.jsx)(n.code,{children:"configure_player_ship_weapon()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_ship_weapon(\n ship_id: EntityId,\n configuration: table {\n frequency: int,\n cannon: int,\n duration: int\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the weapon of the ship identified with ",(0,t.jsx)(n.code,{children:"ship_id"})," using ",(0,t.jsx)(n.code,{children:"configuration"}),". ",(0,t.jsx)(n.code,{children:"frequency"})," determines the frequency of the shots. ",(0,t.jsx)(n.code,{children:"cannon"})," determines the type of cannon. ",(0,t.jsx)(n.code,{children:"duration"})," determines the number of game ticks during which the weapon will be available. Once the duration expires, the weapon reverts to its permanent configuration. If ",(0,t.jsx)(n.code,{children:"duration"})," is omitted, the weapon will be permanently set to this configuration. If ",(0,t.jsx)(n.code,{children:"frequency"})," or ",(0,t.jsx)(n.code,{children:"cannon"})," is omitted, the ship is configured to not have any weapon."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_10, cannon = pewpew.CannonType.DOUBLE}\nlocal ship_id = player_helpers.new_player_ship(100fx, 200fx, 0)\npewpew.configure_player_ship_weapon(ship_id, weapon_config)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_ship_wall_trail",children:(0,t.jsx)(n.code,{children:"configure_player_ship_wall_trail()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_ship_wall_trail(\n ship_id: EntityId,\n configuration: table {\n wall_length: int\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures a wall trail that kills everything inside when the ship it is attached to creates a loop with it. ",(0,t.jsx)(n.code,{children:"wall_length"})," is clamped to [100, 4000]. In symbiosis, the length is 2000. If ",(0,t.jsx)(n.code,{children:"wall_length"})," is not specified, the trail is removed."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.configure_player_ship_wall_trail(ship, {wall_length = 2000})\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_ship",children:(0,t.jsx)(n.code,{children:"configure_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_ship(\n ship_id: EntityId,\n configuration: table {\n swap_inputs: bool\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures various properties of the player ship identified by",(0,t.jsx)(n.code,{children:"id"})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_damage_to_player_ship",children:(0,t.jsx)(n.code,{children:"add_damage_to_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_damage_to_player_ship(\n ship_id: EntityId,\n damage: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Reduces the amount of shield of the player that owns the ship by ",(0,t.jsx)(n.code,{children:"damage"})," points. If the player receives damage while having 0 shields left, the player loses."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_arrow_to_player_ship",children:(0,t.jsx)(n.code,{children:"add_arrow_to_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_arrow_to_player_ship(\n ship_id: EntityId,\n target_id: EntityId,\n color: int\n): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Adds an arrow to the ship identified with ",(0,t.jsx)(n.code,{children:"ship_id"})," pointing towards the entity identified with ",(0,t.jsx)(n.code,{children:"entity_id"}),", and returns the identifier of the arrow. ",(0,t.jsx)(n.code,{children:"color"})," specifies the arrow's color. The arrow is automatically removed when the target entity is destroyed."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"remove_arrow_from_player_ship",children:(0,t.jsx)(n.code,{children:"remove_arrow_from_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.remove_arrow_from_player_ship(\n ship_id: EntityId,\n arrow_id: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Removes the arrow identified by ",(0,t.jsx)(n.code,{children:"arrow_id"})," from the ship identified by ",(0,t.jsx)(n.code,{children:"ship_id"}),"."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"make_player_ship_transparent",children:(0,t.jsx)(n.code,{children:"make_player_ship_transparent()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.make_player_ship_transparent(\n ship_id: EntityId,\n transparency_duration: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Makes the player ship transparent for ",(0,t.jsx)(n.code,{children:"transparency_duration"})," game ticks."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_player_ship_speed",children:(0,t.jsx)(n.code,{children:"set_player_ship_speed()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.set_player_ship_speed(\n ship_id: EntityId,\n factor: FixedPoint,\n offset: FixedPoint,\n duration: int\n): FixedPoint\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Sets and returns the ",(0,t.jsx)(n.strong,{children:"effective speed"})," of the specified player ship as a function of the ",(0,t.jsx)(n.strong,{children:"base speed"})," of the ship. By default, a player ship moves according to its base speed, which is 10 distance units per tick (in the future, different ships may have different base speeds).\nAssuming the base speed of the ship is S, the new effective speed will be ",(0,t.jsx)(n.code,{children:"(factor*S)+offset"}),". ",(0,t.jsx)(n.code,{children:"duration"})," is the number of ticks during which the effective speed will be applied. Afterwards, the ship's speed reverts to its base speed. If ",(0,t.jsx)(n.code,{children:"duration"})," is negative, the effective speed never reverts to the base speed."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_all_entities",children:(0,t.jsx)(n.code,{children:"get_all_entities()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_all_entities(): Listprint()
",id:"print",level:3},{value:"print_debug_info()
",id:"print_debug_info",level:3},{value:"set_level_size()
",id:"set_level_size",level:3},{value:"add_wall()
",id:"add_wall",level:3},{value:"remove_wall()
",id:"remove_wall",level:3},{value:"add_update_callback()
",id:"add_update_callback",level:3},{value:"get_number_of_players()
",id:"get_number_of_players",level:3},{value:"increase_score_of_player()
",id:"increase_score_of_player",level:3},{value:"increase_score_streak_of_player()
",id:"increase_score_streak_of_player",level:3},{value:"get_score_streak_level()
",id:"get_score_streak_level",level:3},{value:"stop_game()
",id:"stop_game",level:3},{value:"get_player_inputs()
",id:"get_player_inputs",level:3},{value:"get_score_of_player()
",id:"get_score_of_player",level:3},{value:"configure_player()
",id:"configure_player",level:3},{value:"configure_player_hud()
",id:"configure_player_hud",level:3},{value:"get_player_configuration()
",id:"get_player_configuration",level:3},{value:"configure_player_ship_weapon()
",id:"configure_player_ship_weapon",level:3},{value:"add_damage_to_player_ship()
",id:"add_damage_to_player_ship",level:3},{value:"add_arrow_to_player_ship()
",id:"add_arrow_to_player_ship",level:3},{value:"remove_arrow_from_player_ship()
",id:"remove_arrow_from_player_ship",level:3},{value:"make_player_ship_transparent()
",id:"make_player_ship_transparent",level:3},{value:"set_player_ship_speed()
",id:"set_player_ship_speed",level:3},{value:"get_all_entities()
",id:"get_all_entities",level:3},{value:"get_entities_colliding_with_disk()
",id:"get_entities_colliding_with_disk",level:3},{value:"get_entity_count()
",id:"get_entity_count",level:3},{value:"get_entity_type()
",id:"get_entity_type",level:3},{value:"play_ambient_sound()
",id:"play_ambient_sound",level:3},{value:"play_sound()
",id:"play_sound",level:3},{value:"create_explosion()
",id:"create_explosion",level:3},{value:"new_asteroid()
",id:"new_asteroid",level:3},{value:"new_asteroid_with_size()
",id:"new_asteroid_with_size",level:3},{value:"new_baf()
",id:"new_baf",level:3},{value:"new_baf_red()
",id:"new_baf_red",level:3},{value:"new_baf_blue()
",id:"new_baf_blue",level:3},{value:"new_bomb()
",id:"new_bomb",level:3},{value:"new_bonus()
",id:"new_bonus",level:3},{value:"new_crowder()
",id:"new_crowder",level:3},{value:"new_floating_message()
",id:"new_floating_message",level:3},{value:"new_customizable_entity()
",id:"new_customizable_entity",level:3},{value:"new_inertiac()
",id:"new_inertiac",level:3},{value:"new_mothership()
",id:"new_mothership",level:3},{value:"new_pointonium()
",id:"new_pointonium",level:3},{value:"new_player_ship()
",id:"new_player_ship",level:3},{value:"new_player_bullet()
",id:"new_player_bullet",level:3},{value:"new_rolling_cube()
",id:"new_rolling_cube",level:3},{value:"new_rolling_sphere()
",id:"new_rolling_sphere",level:3},{value:"new_wary()
",id:"new_wary",level:3},{value:"new_ufo()
",id:"new_ufo",level:3},{value:"rolling_cube_set_enable_collisions_with_walls()
",id:"rolling_cube_set_enable_collisions_with_walls",level:3},{value:"ufo_set_enable_collisions_with_walls()
",id:"ufo_set_enable_collisions_with_walls",level:3},{value:"entity_get_position()
",id:"entity_get_position",level:3},{value:"entity_get_is_alive()
",id:"entity_get_is_alive",level:3},{value:"entity_get_is_started_to_be_destroyed()
",id:"entity_get_is_started_to_be_destroyed",level:3},{value:"entity_set_position()
",id:"entity_set_position",level:3},{value:"entity_set_radius()
",id:"entity_set_radius",level:3},{value:"entity_set_update_callback()
",id:"entity_set_update_callback",level:3},{value:"entity_destroy()
",id:"entity_destroy",level:3},{value:"entity_react_to_weapon()
",id:"entity_react_to_weapon",level:3},{value:"customizable_entity_set_position_interpolation()
",id:"customizable_entity_set_position_interpolation",level:3},{value:"customizable_entity_set_mesh()
",id:"customizable_entity_set_mesh",level:3},{value:"customizable_entity_set_flipping_meshes()
",id:"customizable_entity_set_flipping_meshes",level:3},{value:"customizable_entity_set_mesh_color()
",id:"customizable_entity_set_mesh_color",level:3},{value:"customizable_entity_set_string()
",id:"customizable_entity_set_string",level:3},{value:"customizable_entity_set_mesh_xyz()
",id:"customizable_entity_set_mesh_xyz",level:3},{value:"customizable_entity_set_mesh_z()
",id:"customizable_entity_set_mesh_z",level:3},{value:"customizable_entity_set_mesh_scale()
",id:"customizable_entity_set_mesh_scale",level:3},{value:"customizable_entity_set_mesh_xyz_scale()
",id:"customizable_entity_set_mesh_xyz_scale",level:3},{value:"customizable_entity_set_mesh_angle()
",id:"customizable_entity_set_mesh_angle",level:3},{value:"customizable_entity_skip_mesh_attributes_interpolation()
",id:"customizable_entity_skip_mesh_attributes_interpolation",level:3},{value:"customizable_entity_configure_music_response()
",id:"customizable_entity_configure_music_response",level:3},{value:"customizable_entity_add_rotation_to_mesh()
",id:"customizable_entity_add_rotation_to_mesh",level:3},{value:"customizable_entity_set_visibility_radius()
",id:"customizable_entity_set_visibility_radius",level:3},{value:"customizable_entity_configure_wall_collision()
",id:"customizable_entity_configure_wall_collision",level:3},{value:"customizable_entity_set_player_collision_callback()
",id:"customizable_entity_set_player_collision_callback",level:3},{value:"customizable_entity_set_weapon_collision_callback()
",id:"customizable_entity_set_weapon_collision_callback",level:3},{value:"customizable_entity_start_spawning()
",id:"customizable_entity_start_spawning",level:3},{value:"customizable_entity_start_exploding()
",id:"customizable_entity_start_exploding",level:3}];function r(e){const n={blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"pewpew-library",children:"pewpew library"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"pewpew"})," library contains all the functions for configuring levels and managing entities."]}),"\n",(0,t.jsx)(n.h2,{id:"enums",children:"Enums"}),"\n",(0,t.jsx)(n.h3,{id:"entitytype",children:"EntityType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"ASTEROID"}),"\n",(0,t.jsx)(n.li,{children:"BAF"}),"\n",(0,t.jsx)(n.li,{children:"INERTIAC"}),"\n",(0,t.jsx)(n.li,{children:"MOTHERSHIP"}),"\n",(0,t.jsx)(n.li,{children:"MOTHERSHIP_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"ROLLING_CUBE"}),"\n",(0,t.jsx)(n.li,{children:"ROLLING_SPHERE"}),"\n",(0,t.jsx)(n.li,{children:"UFO"}),"\n",(0,t.jsx)(n.li,{children:"WARY"}),"\n",(0,t.jsx)(n.li,{children:"CROWDER"}),"\n",(0,t.jsx)(n.li,{children:"CUSTOMIZABLE_ENTITY"}),"\n",(0,t.jsx)(n.li,{children:"SHIP"}),"\n",(0,t.jsx)(n.li,{children:"BOMB"}),"\n",(0,t.jsx)(n.li,{children:"BAF_BLUE"}),"\n",(0,t.jsx)(n.li,{children:"BAF_RED"}),"\n",(0,t.jsx)(n.li,{children:"WARY_MISSILE"}),"\n",(0,t.jsx)(n.li,{children:"UFO_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"PLAYER_BULLET"}),"\n",(0,t.jsx)(n.li,{children:"BOMB_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"PLAYER_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"BONUS"}),"\n",(0,t.jsx)(n.li,{children:"FLOATING_MESSAGE"}),"\n",(0,t.jsx)(n.li,{children:"POINTONIUM"}),"\n",(0,t.jsx)(n.li,{children:"BONUS_IMPLOSION"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"mothershiptype",children:"MothershipType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"THREE_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"FOUR_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"FIVE_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"SIX_CORNERS"}),"\n",(0,t.jsx)(n.li,{children:"SEVEN_CORNERS"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"cannontype",children:"CannonType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"SINGLE"}),"\n",(0,t.jsx)(n.li,{children:"TIC_TOC"}),"\n",(0,t.jsx)(n.li,{children:"DOUBLE"}),"\n",(0,t.jsx)(n.li,{children:"TRIPLE"}),"\n",(0,t.jsx)(n.li,{children:"FOUR_DIRECTIONS"}),"\n",(0,t.jsx)(n.li,{children:"DOUBLE_SWIPE"}),"\n",(0,t.jsx)(n.li,{children:"HEMISPHERE"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"cannonfrequency",children:"CannonFrequency"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"FREQ_30"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_15"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_10"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_7_5"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_6"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_5"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_3"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_2"}),"\n",(0,t.jsx)(n.li,{children:"FREQ_1"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"bombtype",children:"BombType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"FREEZE"}),"\n",(0,t.jsx)(n.li,{children:"REPULSIVE"}),"\n",(0,t.jsx)(n.li,{children:"ATOMIZE"}),"\n",(0,t.jsx)(n.li,{children:"SMALL_ATOMIZE"}),"\n",(0,t.jsx)(n.li,{children:"SMALL_FREEZE"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"bonustype",children:"BonusType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"REINSTANTIATION"}),"\n",(0,t.jsx)(n.li,{children:"SHIELD"}),"\n",(0,t.jsx)(n.li,{children:"SPEED"}),"\n",(0,t.jsx)(n.li,{children:"WEAPON"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"weapontype",children:"WeaponType"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"BULLET"}),"\n",(0,t.jsx)(n.li,{children:"FREEZE_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"REPULSIVE_EXPLOSION"}),"\n",(0,t.jsx)(n.li,{children:"ATOMIZE_EXPLOSION"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"asteroidsize",children:"AsteroidSize"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"SMALL"}),"\n",(0,t.jsx)(n.li,{children:"MEDIUM"}),"\n",(0,t.jsx)(n.li,{children:"LARGE"}),"\n",(0,t.jsx)(n.li,{children:"VERY_LARGE"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,t.jsx)(n.h3,{id:"print",children:(0,t.jsx)(n.code,{children:"print()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.print(str: string)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Prints ",(0,t.jsx)(n.code,{children:"str"})," in the console for debugging."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local some_number = 42\npewpew.print("the value of some_number is: " .. some_number)\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"print_debug_info",children:(0,t.jsx)(n.code,{children:"print_debug_info()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.print_debug_info()\n"})}),"\n",(0,t.jsx)(n.p,{children:"Prints debug info: the number of entities created and the amount of memory used by the script."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.print_debug_info()\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_level_size",children:(0,t.jsx)(n.code,{children:"set_level_size()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.set_level_size(\n width: FixedPoint,\n height: FixedPoint\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Sets the level's size. Implicetely adds walls to make sure that entities can not go outside of the level's boundaries. ",(0,t.jsx)(n.code,{children:"width"})," and ",(0,t.jsx)(n.code,{children:"height"})," are clamped to the range ]0fx, 6000fx]. If this function is not called, the level size is (10fx, 10fx), which is uselessly small for most cases."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local width = 300fx\nlocal height = 200fx\npewpew.set_level_size(width, height)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_wall",children:(0,t.jsx)(n.code,{children:"add_wall()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_wall(\n start_x: FixedPoint,\n start_y: FixedPoint,\n end_x: FixedPoint,\n end_y: FixedPoint\n): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Adds a wall to the level from (",(0,t.jsx)(n.code,{children:"start_x"}),",",(0,t.jsx)(n.code,{children:"start_y"}),") to (",(0,t.jsx)(n.code,{children:"end_x"}),",",(0,t.jsx)(n.code,{children:"end_y"}),"), and returns its wall ID. A maximum of 200 walls can be added to a level."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.add_wall(100fx, 100fx, 200fx, 200fx)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"remove_wall",children:(0,t.jsx)(n.code,{children:"remove_wall()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.remove_wall(wall_id: int)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Remove the wall with the given ",(0,t.jsx)(n.code,{children:"wall_id"}),"."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local wall_id = pewpew.add_wall(100fx, 100fx, 200fx, 200fx)\n-- Later, when the wall needs to be removed:\npewpew.remove_wall(wall_id)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_update_callback",children:(0,t.jsx)(n.code,{children:"add_update_callback()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_update_callback(update_callback: function)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Adds a callback that will be updated at each game tick."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local tick_count = 0\npewpew.add_update_callback(function()\n pewpew.print("this is tick " .. tick_count)\n tick_count = tick_count + 1\nend)\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_number_of_players",children:(0,t.jsx)(n.code,{children:"get_number_of_players()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_number_of_players(): int\n"})}),"\n",(0,t.jsx)(n.p,{children:"Returns the number of players in the game."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"increase_score_of_player",children:(0,t.jsx)(n.code,{children:"increase_score_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.increase_score_of_player(\n player_index: int,\n delta: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Increases the score of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"})," by an amount of ",(0,t.jsx)(n.code,{children:"delta"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. Note that ",(0,t.jsx)(n.code,{children:"delta"})," can be negative."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"increase_score_streak_of_player",children:(0,t.jsx)(n.code,{children:"increase_score_streak_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.increase_score_streak_of_player(\n player_index: int,\n delta: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Increases the score streak counter of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"})," by an amount of ",(0,t.jsx)(n.code,{children:"delta"}),". This counter is used to determine at which level of score streak the player is at. In turn, the score streak level is used to determine how much pointonium is given. Typically the score streak counter should be increased when an enemy is destroyed with the same score that the enemy provide. ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. Note that ",(0,t.jsx)(n.code,{children:"delta"})," can be negative."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_score_streak_level",children:(0,t.jsx)(n.code,{children:"get_score_streak_level()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_score_streak_level(player_index: int): int\n"})}),"\n",(0,t.jsx)(n.p,{children:"Returns a number between 0 and 3. 0 is the lowest score streak (no pointonium is given), while 3 is the highest (3 pointoniums is usually given)"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"stop_game",children:(0,t.jsx)(n.code,{children:"stop_game()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.stop_game()\n"})}),"\n",(0,t.jsx)(n.p,{children:"Ends the current game."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_player_inputs",children:(0,t.jsx)(n.code,{children:"get_player_inputs()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_player_inputs(player_index: int): FixedPoint, FixedPoint, FixedPoint, FixedPoint\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns the inputs of the player at the specified ",(0,t.jsx)(n.code,{children:"index"}),". The return values are in order: the movement joystick's angle (between 0 and 2pi), the movement joystick's distance (between 0 and 1), the shoot joystick's angle (between 0 and 2pi), and the shoot joystick's distance (between 0 and 1)."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local move_angle, move_distance, shoot_angle, shoot_distance = pewpew.get_player_inputs(0)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_score_of_player",children:(0,t.jsx)(n.code,{children:"get_score_of_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_score_of_player(player_index: int): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns the score of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player",children:(0,t.jsx)(n.code,{children:"configure_player()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player(\n player_index: int,\n configuration: table {\n has_lost: bool,\n shield: int,\n camera_x_override: FixedPoint,\n camera_y_override: FixedPoint,\n camera_distance: FixedPoint,\n camera_rotation_x_axis: FixedPoint,\n move_joystick_color: int,\n shoot_joystick_color: int\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),". ",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]. A ",(0,t.jsx)(n.code,{children:"camera_distance"})," less than 0fx makes the camera move away from the ship. ",(0,t.jsx)(n.code,{children:"camera_rotation_x_axis"})," is in radian and rotates along the X axis.\nTo temporarily override the XY position of the camera, set ",(0,t.jsx)(n.strong,{children:"both"})," ",(0,t.jsx)(n.code,{children:"camera_x_override"})," and ",(0,t.jsx)(n.code,{children:"camera_y_override"}),"; this will make the camera be interpolated from wherever it was, to that new position."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"pewpew.configure_player(0, {shield = 3, camera_distance = 50fx, move_joystick_color = 0xffff00ff})\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_hud",children:(0,t.jsx)(n.code,{children:"configure_player_hud()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_hud(\n player_index: int,\n configuration: table {\n top_left_line: string\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the player's HUD.",(0,t.jsx)(n.code,{children:"player_index"})," must in the range [0, get_number_of_players() - 1]."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'pewpew.configure_player_hud(0, {top_left_line = "Hello World"})\n'})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_player_configuration",children:(0,t.jsx)(n.code,{children:"get_player_configuration()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_player_configuration(player_index: int): table {\n shield: int,\n has_lost: bool\n }\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Returns a map containing the configuration of the player at the specified ",(0,t.jsx)(n.code,{children:"player_index"}),"."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local shield = pewpew.get_player_configuration(0).shield\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"configure_player_ship_weapon",children:(0,t.jsx)(n.code,{children:"configure_player_ship_weapon()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.configure_player_ship_weapon(\n ship_id: EntityId,\n configuration: table {\n frequency: int,\n cannon: int,\n duration: int\n }\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Configures the weapon of the ship identified with ",(0,t.jsx)(n.code,{children:"ship_id"})," using ",(0,t.jsx)(n.code,{children:"configuration"}),". ",(0,t.jsx)(n.code,{children:"frequency"})," determines the frequency of the shots. ",(0,t.jsx)(n.code,{children:"cannon"})," determines the type of cannon. ",(0,t.jsx)(n.code,{children:"duration"})," determines the number of game ticks during which the weapon will be available. Once the duration expires, the weapon reverts to its permanent configuration. If ",(0,t.jsx)(n.code,{children:"duration"})," is omitted, the weapon will be permanently set to this configuration. If ",(0,t.jsx)(n.code,{children:"frequency"})," or ",(0,t.jsx)(n.code,{children:"cannon"})," is omitted, the ship is configured to not have any weapon."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local weapon_config = {frequency = pewpew.CannonFrequency.FREQ_10, cannon = pewpew.CannonType.DOUBLE}\nlocal ship_id = player_helpers.new_player_ship(100fx, 200fx, 0)\npewpew.configure_player_ship_weapon(ship_id, weapon_config)\n"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_damage_to_player_ship",children:(0,t.jsx)(n.code,{children:"add_damage_to_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_damage_to_player_ship(\n ship_id: EntityId,\n damage: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Reduces the amount of shield of the player that owns the ship by ",(0,t.jsx)(n.code,{children:"damage"})," points. If the player receives damage while having 0 shields left, the player loses."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_arrow_to_player_ship",children:(0,t.jsx)(n.code,{children:"add_arrow_to_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.add_arrow_to_player_ship(\n ship_id: EntityId,\n target_id: EntityId,\n color: int\n): int\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Adds an arrow to the ship identified with ",(0,t.jsx)(n.code,{children:"ship_id"})," pointing towards the entity identified with ",(0,t.jsx)(n.code,{children:"entity_id"}),", and returns the identifier of the arrow. ",(0,t.jsx)(n.code,{children:"color"})," specifies the arrow's color. The arrow is automatically removed when the target entity is destroyed."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"remove_arrow_from_player_ship",children:(0,t.jsx)(n.code,{children:"remove_arrow_from_player_ship()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.remove_arrow_from_player_ship(\n ship_id: EntityId,\n arrow_id: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Removes the arrow identified by ",(0,t.jsx)(n.code,{children:"arrow_id"})," from the ship identified by ",(0,t.jsx)(n.code,{children:"ship_id"}),"."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"make_player_ship_transparent",children:(0,t.jsx)(n.code,{children:"make_player_ship_transparent()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.make_player_ship_transparent(\n ship_id: EntityId,\n transparency_duration: int\n)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Makes the player ship transparent for ",(0,t.jsx)(n.code,{children:"transparency_duration"})," game ticks."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_player_ship_speed",children:(0,t.jsx)(n.code,{children:"set_player_ship_speed()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.set_player_ship_speed(\n ship_id: EntityId,\n factor: FixedPoint,\n offset: FixedPoint,\n duration: int\n): FixedPoint\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Sets and returns the ",(0,t.jsx)(n.strong,{children:"effective speed"})," of the specified player ship as a function of the ",(0,t.jsx)(n.strong,{children:"base speed"})," of the ship. By default, a player ship moves according to its base speed, which is 10 distance units per tick (in the future, different ships may have different base speeds).\nAssuming the base speed of the ship is S, the new effective speed will be ",(0,t.jsx)(n.code,{children:"(factor*S)+offset"}),". ",(0,t.jsx)(n.code,{children:"duration"})," is the number of ticks during which the effective speed will be applied. Afterwards, the ship's speed reverts to its base speed. If ",(0,t.jsx)(n.code,{children:"duration"})," is negative, the effective speed never reverts to the base speed."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_all_entities",children:(0,t.jsx)(n.code,{children:"get_all_entities()"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"pewpew.get_all_entities(): Listlocal weapon_config = {frequency = pewpew.CannonFrequency.FREQ_10, cannon = pewpew.CannonType.DOUBLE}
local ship_id = player_helpers.new_player_ship(100fx, 200fx, 0)
pewpew.configure_player_ship_weapon(ship_id, weapon_config)
configure_player_ship_wall_trail()
​pewpew.configure_player_ship_wall_trail(
ship_id: EntityId,
configuration: table {
wall_length: int
}
)
Configures a wall trail that kills everything inside when the ship it is attached to creates a loop with it. wall_length
is clamped to [100, 4000]. In symbiosis, the length is 2000. If wall_length
is not specified, the trail is removed.
++Example:
++pewpew.configure_player_ship_wall_trail(ship, {wall_length = 2000})
configure_player_ship()
​pewpew.configure_player_ship(
ship_id: EntityId,
configuration: table {
swap_inputs: bool
}
)
Configures various properties of the player ship identified byid
add_damage_to_player_ship()
​pewpew.add_damage_to_player_ship(
ship_id: EntityId,
damage: int
)
Reduces the amount of shield of the player that owns the ship by damage
points. If the player receives damage while having 0 shields left, the player loses.
creat
pewpew.create_explosion(200fx, 100fx, 0xffffffff, 1fx, 20) -- medium explosion
pewpew.create_explosion(300fx, 100fx, 0xffffffff, 3fx, 50) -- large red explosion
+add_particle()
​
+pewpew.add_particle(
x: FixedPoint,
y: FixedPoint,
z: FixedPoint,
dx: FixedPoint,
dy: FixedPoint,
dz: FixedPoint,
color: int,
duration: int
)
+Adds a particle at the given position, that moves at the given speed, with the given color and duration. The engine may not spawn all particles if are already a lot of particles alive already spawned (e.g. more than 1000)
+
+Example:
+pewpew.add_particle(10fx, 10fx, 0fx, 4fx, 0fx, 0fx, 0xffffffff, 40)
+
+
new_asteroid()
​
pewpew.new_asteroid(
x: FixedPoint,
y: FixedPoint
): EntityId
Creates a new Asteroid at the location x
,y
and returns its entityId.
@@ -334,7 +370,7 @@ new_crowde
Creates a new Crowder at the location x
,y
, and returns its entityId.
new_floating_message()
​
-pewpew.new_floating_message(
x: FixedPoint,
y: FixedPoint,
str: string,
config: table {
scale: FixedPoint,
ticks_before_fade: int,
is_optional: bool
}
): EntityId
+pewpew.new_floating_message(
x: FixedPoint,
y: FixedPoint,
str: string,
config: table {
scale: FixedPoint,
dz: FixedPoint,
ticks_before_fade: int,
is_optional: bool
}
): EntityId
Creates a new floating message at the location x
,y
, with str
as the message. The scale is a number that determines how large the message will be. 1
is the default scale. ticks_before_fade
determines how many ticks occur before the message starts to fade out. is_optional
can be used to tell the game if the message can be hidden depending on the user's UI settings.
If not specified, scale
is 1, ticks_before_fade
is 30 and is_optional
is false
.
Returns the floating message's entityId.
@@ -351,6 +387,10 @@ new_inert
pewpew.new_inertiac(
x: FixedPoint,
y: FixedPoint,
acceleration: FixedPoint,
angle: FixedPoint
): EntityId
Creates a new Inertiac at the location x
,y
, and returns its entityId. The inertiac will accelerate according to acceleration
. It spawns with a random velocity in a direction specified by angle
.
+new_kamikaze()
​
+pewpew.new_kamikaze(
x: FixedPoint,
y: FixedPoint,
angle: FixedPoint
): EntityId
+Creates a new Kamikaze at the location x
,y
that starts moving in the direction specified by angle
.
+
new_mothership()
​
pewpew.new_mothership(
x: FixedPoint,
y: FixedPoint,
type: int,
angle: FixedPoint
): EntityId
Creates a new Mothership at the location x
,y
, and returns its entityId.
@@ -359,10 +399,18 @@ new_mot
pewpew.new_mothership(50fx, 50fx, pewpew.MothershipType.THREE_CORNERS, fmath.tau() / 4fx)
+new_mothership_bullet()
​
+pewpew.new_mothership_bullet(
x: FixedPoint,
y: FixedPoint,
angle: FixedPoint,
speed: FixedPoint,
color: int,
large: bool
): EntityId
+Creates a new mothership bullet.
+
new_pointonium()
​
pewpew.new_pointonium(
x: FixedPoint,
y: FixedPoint,
value: int
): EntityId
Creates a new Pointonium at the location x
,y
. Value must be 64, 128, or 256.
+new_plasma_field()
​
+pewpew.new_plasma_field(
ship_a_id: EntityId,
ship_b_id: EntityId,
config: table {
length: FixedPoint
}
): EntityId
+Creates a new plasma field between ship_a
and ship_b
, and returns its entityId. If ship_a
or ship_b
is destroyed, the plasma field is destroyed as well.
+
new_player_ship()
​
pewpew.new_player_ship(
x: FixedPoint,
y: FixedPoint,
player_index: int
): EntityId
Creates a new Player Ship at the location x
,y
for the player identified by player_index
, and returns its entityId.
@@ -379,6 +427,18 @@ new
pewpew.new_rolling_sphere(
x: FixedPoint,
y: FixedPoint,
angle: FixedPoint,
speed: FixedPoint
): EntityId
Creates a new Rolling Sphere at the location x
,y
, and returns its entityId.
+new_spiny()
​
+pewpew.new_spiny(
x: FixedPoint,
y: FixedPoint,
angle: FixedPoint,
attractivity: FixedPoint
): EntityId
+Creates a new Spiny at the location x
,y
that starts moving in the direction specified by angle
. attractivity
specifies how much the Spiny is attracted to the closest player: 1fx is normal attractivity.
+
+new_super_mothership()
​
+pewpew.new_super_mothership(
x: FixedPoint,
y: FixedPoint,
type: int,
angle: FixedPoint
): EntityId
+Creates a new Super Mothership at the location x
,y
, and returns its entityId.
+
+Example:
+pewpew.new_super_mothership(50fx, 50fx, pewpew.MothershipType.THREE_CORNERS, fmath.tau() / 4fx)
+
+
new_wary()
​
pewpew.new_wary(
x: FixedPoint,
y: FixedPoint
): EntityId
Creates a new Wary at the location x
,y
.
@@ -443,9 +503,17 @@ pewpew.entity_react_to_weapon(
entity_id: EntityId,
weapon: table {
type: int,
x: FixedPoint,
y: FixedPoint,
player_index: int
}
): bool
Makes the entity identified by id
react to the weapon described in weapon_description
. Returns whether the entity reacted to the weapon. The returned value is typically used to decide whether the weapon should continue to exist or not. In the case of an explosion, x
and y
should store the origin of the explosion. In the case of a bullet, x
and y
should store the vector of the bullet. The player identified by player_index
will be assigned points. If player_index
is invalid, no player will be assigned points.
+entity_add_mace()
​
+pewpew.entity_add_mace(
target_id: EntityId,
config: table {
distance: FixedPoint,
angle: FixedPoint,
rotation_speed: FixedPoint,
type: int
}
): EntityId
+Adds a mace to the entity identified with entity_id
. If rotation_speed
exists, the mace will have a natural rotation, otherwise it will move due to inertia.
+
customizable_entity_set_position_interpolation()
​
pewpew.customizable_entity_set_position_interpolation(
entity_id: EntityId,
enable: bool
)
-Sets whether the position of the mesh wil be interpolated when rendering. In general, this should be set to true if the entity will be moving smoothly.
+Sets whether the position of the mesh wil be interpolated when rendering. In general, this should be set to true if the entity will be moving.
+
+customizable_entity_set_angle_interpolation()
​
+pewpew.customizable_entity_set_angle_interpolation(
entity_id: EntityId,
enable: bool
)
+Sets whether the angle of the mesh wil be interpolated when rendering. Angle interpolation is enabled by default.
customizable_entity_set_mesh()
​
pewpew.customizable_entity_set_mesh(
entity_id: EntityId,
file_path: string,
index: int
)
@@ -549,6 +617,14 @@ customizable_entity_start_exploding()
​
pewpew.customizable_entity_start_exploding(
entity_id: EntityId,
explosion_duration: int
)
-Makes the customizable entity identified by id
explode for a duration of explosion_duration
game ticks. After the explosion, the entity is destroyed. explosion_duration
must be less than 255. Any scale applied to the entity is also applied to the explosion.
+Makes the customizable entity identified by id
explode for a duration of explosion_duration
game ticks. After the explosion, the entity is destroyed. explosion_duration
must be less than 255. Any scale applied to the entity is also applied to the explosion.
+
+customizable_entity_set_tag()
​
+pewpew.customizable_entity_set_tag(
entity_id: EntityId,
tag: int
)
+Sets a tag on customizable entities. The tag can be read back with customizable_entity_get_tag
.
+
+customizable_entity_get_tag()
​
+pewpew.customizable_entity_get_tag(entity_id: EntityId): int
+Returns the tag that was set, or 0 if no tag was set.