Search

Compare Yourself

What software do you make games with? (select more then one)

Loading ... Loading ...

Make a Tower defense game (Part 1)

In this GameMaker video tutorial you learn how to make a Tower defense like game. This tutorial works with GM Lite.

From Wikipedia: “Tower defense  is a subgenre of real-time strategy computer games. The goal is to try to stop enemies from crossing the map by building towers which shoot at them as they pass. Enemies and towers usually have varied abilities and costs. When an enemy is defeated the player earns money or points, which are used to buy or upgrade towers.”

(credit BlueLemonKnight)


13 comments to Make a Tower defense game (Part 1)

  • you dont have to use code with gamemaker 8.o. this is what you do: when obj bullet is created, test object enemy. if there is more than one enemy, than move bullet to obj enemy. ELSE, send bullet upwards at a speed of 12.

  • pece

    to much coding to hard sorry doesnt help

  • Give the code below,please.
    I’m interested in doing such game.
    Thanks for you co-operation.

  • Max

    post the code please
    im in game maker 8 and it keeps saying that there is an error with the code that you have provided

  • Help me!

    When I try to enter the code it says:
    ERROR at line 3 pos 85: Symbol ) expected
    When I added a ) it still said the same this
    Here’s the code:

    if (distance_to_object (enemy) <2000)
    (
    move_towards_point(instance_nearest(x,y,enemy).x,instance_nearest(x,y,enemy).y, 18);[THIS IS LINE 3 POSITION 85]
    )
    else
    (
    instance_destroy();
    )

  • Jake

    The first code in GM 6.1 PRO must be:

    if distance_to_object(obj_enemy) < 2000
    {
    move_towards_point(instance_nearest(x,y,obj_enemy) .x, instance_nearest(x,y,obj_enemy) .y, 18);
    }
    else
    {
    instance_destroy();
    }

    There.

  • cohen

    try this

    if (distance_to_object(enemy) <2000)
    {
    move_towards_point(instance_nearest(x,y,enemy).x,instance_nearest(x,y,enemy).y, 10
    )}
    else
    {
    instance_destroy();
    }

  • cohen

    i think it only works for game maker 8

  • mackenzie

    when the bullet collides with the enemy, it destroys all the enemies that have spawned. can you help?

  • Ryan Smith

    {
    if (distance_to_object(Enemy)<2000)

    {move_towards_point(instance_nearest(x,y,Enemy).x,instance_nearest(x,y,Enemy).y, 18) }

    else
    {
    instance_destroy();
    }
    }

  • :(

    this doesnt help me i suk with computers but i rely want to make a tower defense game plus i only have the lite version

  • ELEMENTO0

    I DON’T SEE THE OTHER NUMBER BESIDE OF 18.
    YOU ARE NOOBS. :P

  • Ted Nilsson

    i dont know how you get that background you are painting on is it like just to make a green background and load it?

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>