Log in
Search
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.Turret code
3 posters
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
Turret code
A code for making a turret/shooting enemy.
- Code:
//Turret fires if it can see the player
if collision_line(x,y,p1.x,p1.y,wall,1,0)//checks if their is a wall in the way
{x=x}//filler
else {if instance_exists(bullet)=false//check if there are bullets on the screen
{instance_create(x,y,bullet)}}//creates a bullet
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|