Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: http://gameml.iowoi.org/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com
Keywords


Turret code

View previous topic View next topic Go down

Turret code

Post by Dez1100 on Wed Feb 10, 2010 3:24 am

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
avatar
Dez1100
GameML Basic
GameML Basic

Posts : 89
Points : 29838
GameML Reputation : 1
Join date : 2009-07-03
Age : 20
Location : Australia

View user profile http://bioforums.ownbb.com/

Back to top Go down

Re: Turret code

Post by Sparx the Cy-Wolf on Wed Feb 10, 2010 6:02 am

Um..you won't mind explaining the code would you?
avatar
Sparx the Cy-Wolf
Admin
Admin

Posts : 1775
Points : 31875
GameML Reputation : 5
Join date : 2009-06-07
Age : 26
Location : Mother ship

View user profile http://www.yoyogames.com/members/Sparx%20the%20Cy-wolf

Back to top Go down

Re: Turret code

Post by themastersword on Sun Mar 14, 2010 1:48 am

Need to put a "//" before "the way"!
avatar
themastersword
GameML Noob
GameML Noob

Posts : 5
Points : 27853
GameML Reputation : 2
Join date : 2010-01-06
Age : 21
Location : Australia

View user profile http://blok-studios.com/

Back to top Go down

Re: Turret code

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum