function Update(){ // your update script stuff UpdateBullets();} function game() { // your game code SetUpdateScript("Update()"); MapEngine("map.rmp", 60);}
var mw = GetLayerWidth(0) * GetTileWidth();var mh = GetLayerHeight(0) * GetTileHeight();
while (AreKeysLeft()) { if (GetKey() == KEY_SPACE) CreateBullet("player"); }
Noticed this Code: (javascript) [Select]var mw = GetLayerWidth(0) * GetTileWidth();var mh = GetLayerHeight(0) * GetTileHeight();Whats going on here?
//If the player presses space if (IsKeyPressed(KEY_SPACE)){ CreateBullet("Player")}
I was thinking of making a variable to assign itself to != isKeyPressed(); but I have a big feeling that's going overboard and will not work.The variable will be too big and I think this would kill computer memory.
var key_hit = false;function Update(){ if (IsKeyPressed(KEY_CTRL) && !key_hit) { do_something(); key_hit = true; } if (!IsKeyPressed(KEY_CTRL)) key_hit = false;}
var key_hit = false;function Update(){UpdateBullets();if (!IsKeyPressed(KEY_Z)) key_hit = false;if (IsKeyPressed(KEY_Z) && key_hit == false){key_hit = true;CreateBullet("ghost"); }