I need help with my tower defense game

I'm developing a tower defense game for my college finals. I've gotten the monsters and towers implemented, but for the life of me I don't know how to get the towers to shoot at the monster or implement lives into the game. Here are links to my program's classes:

Please help!

Tagged:

Answers

  • i gather we don't have your images and therefore can't run your code

    why don't you zip it all?

    look here

    http://www.openprocessing.org/search/?q=tower

  • i am sure you'll find all in the examples above.

  • I need this version working, it's the one I showed my instructor.

  • yeah...

    i didn't mean to copy those

    i meant to learn from those and apply the concepts to your sketch...

  • the general approach of shooting:

    let's say you have a cannon ball: draw a ellipse in draw() using ellipse()

    have background(0); at the beginning of draw()

    store the position (x and y) and change it over time by adding speedX and speedY to it (or by using a formula using e.g. framecount)

    since draw runs again and again (loops) 60 times per second, the ball is drawn deleted (with the entire screen) changes its position and is drawn again

    the ball starts when mouseClicked or space bar pressed or so

    the ball stops when it hits something (ground)

    in the examples sections there are a lot of movements (see website)

    also in the ide of processing there're examples (file menu)

    for your task, there is gravity coming in probably changing speedY or so, so your ball flies along a curve /\

    for gravity there should also be examples

    pm me when you need more

    ;-)

  • I don't need gravity. How can I make it so the enemies die when I click 'em? I'm not used to processing, I honestly should have stuck to C#.

  • edited December 2014

    err... tower defense... a brick flies from the tower to the enemy?

    well since it is a round curve of a flying brick, you need gravity to make the curve round

    see also http://openprocessing.org/sketch/77863

  • since these are colellege finals, show your code

    the maths is the same in c# and here in processing

  • you don't click on an enemy, you rather enter angle and force to measure how far the brick flies?

  • (chrisir, google "tower defence". it's a top down game where you place resources to repel oncoming enemies.)

  • oups...

    ;-)

Sign In or Register to comment.