Tower Defence

urhungryurhungry Member Posts: 112
edited November -1 in Working with GS (Mac)
Hey I'm making a tower defence game and I need some help. Okay so how do u make the towers spawn where the mouse clicks? Also how do I make the enemys only walk down a certain purple path? And how do I make the towers or pineapples in my game trak and auto fire at the enemies? Also how do I do a money system so that building towers costs money and u gain money from destroying enemies? Thx a ton
urhungry

Comments

  • urhungryurhungry Member Posts: 112
    Ok thx. Any way I can copy the code from your project to mine?
  • urhungryurhungry Member Posts: 112
    K
  • urhungryurhungry Member Posts: 112
    The link dosent work.
  • urhungryurhungry Member Posts: 112
    Thx
  • urhungryurhungry Member Posts: 112
    It's working hreat. Any way to copy my scripts from one actor to another in my project? Thx
  • urhungryurhungry Member Posts: 112
    Ok great thx!
  • urhungryurhungry Member Posts: 112
    Ok so I've got the money and placement down. Now how do I do enemy pathfinding and auto firing? Thx and sry for all the questions.
  • urhungryurhungry Member Posts: 112
    Anyone?
  • urhungryurhungry Member Posts: 112
    No I just want them to follow the path. I can wait for a video, thx for offering to make them. I could do this in another program but I don't know how to do it in game salad.
  • JGary321JGary321 Member Posts: 1,246
    Here's an example of following a set path.

    http://gamesalad.com/game/play/8508

    All I did was create 4 actors called

    Left
    Right
    Up
    Down

    Then in your actor: When actor collides with Left change velocity to (blah blah)

    Then just place them appropriately in your scene & make sure to turn Visible to off.

    -JGary
  • butterbeanbutterbean Member Posts: 4,315
    JGary, when are you releasing your Blightened lands game? It's coming along nicely!

    Where do you mind my asking, did you get your graphics from? They're really nice!
  • urhungryurhungry Member Posts: 112
    Ok thx I'll try it later.
  • JGary321JGary321 Member Posts: 1,246
    As far as when I release? I could finish it within a week. I'm slowly finishing it. Basically as soon as the save feature is implemented I will be releasing it that week.

    The resources I am using are from RPGMaker VX. The UI I made myself. It's simple, but gets the job done.

    http://www.tkool.jp/products/rpgvx/eng/faq.html#faq05

    The FAQs at the bottom DO say you can release commercial games. We'll just see if I get any lawyer calls. I'll let ya know =p

    I actually use RPGMaker VX to create my maps. It is a great tile based program. So the Battle Map & soon to be World Map take seconds to create.
  • urhungryurhungry Member Posts: 112
    How do u use rpg maker? I only havE a mac but I want to make RPGs with it?
  • butterbeanbutterbean Member Posts: 4,315
    Well it looks great JGary! Looking forward to your game releasing!
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    here, try using darwine to use rpgmaker:
    http://darwine.sourceforge.net/download.php

    using this program u can use any application windows can.
  • urhungryurhungry Member Posts: 112
    Really?!?! Great thx! I'll try it right now!
  • urhungryurhungry Member Posts: 112
    Ok the enemys now follow the path. All that I need is for the towers to fire. How do I do this? Thx for all of the help
    urhungry
  • urhungryurhungry Member Posts: 112
    Also I'm having some trouble with making the enemys start when you click start wave. Any tips?thx so much and sry for all of the questions.
  • cbtcbt Member Posts: 644
    Sorry for popping this up, but;

    "All that I need is for the towers to fire. How do I do this?"

    Is there any answer for that? I don't want a walk-through, I just want to know can it be done?
  • urhungryurhungry Member Posts: 112
    well, i know how to make it fire, but i dont know if its even possible to point it in the direction of the enemies, so sorry about that bit.
  • rebumprebump Member Posts: 1,058
    Probably by using many of these concepts:

    - lots of game level attributes to hold enemy info such as position X/Y, etc. (since currently colliding actors cannot inspect each other's info unless shared inconveniently through game level attributes)!!!

    - long actor rule/behavior sets

    - multiple actors/sprites per tower (one for base, one for turret, possibly an oversized invisible one for collision)

    - use of the "accelerate towards" behavior for the projectiles (i.e. bullets/missiles/lasers)

    - possible use of the "magnitude()" function to determine when to start/stop firing (if the oversized invisible tower collision actor method doesn't pan out)

    - invisible tower build pads/sites along the enemy travel path whose behavior you change when a tower is placed on it

    - invisible walls along the enemy travel path to force the enemy to move along the path properly

    The main thing you would want to think through on this type of game before attempting in the current GS incarnation is:

    - portable/reusable rules/behaviors for moving the enemy

    - portable/reusable rules/behaviors for determining how missiles target their intended target

    - the 'rolling' re-use of the various game level attributes (since attributes arrays, or even better, associative arrays are not available yet not to mention the aforementioned actor-to-actor attribute inspection during collision)

    Just my thoughts on it. I've seen one GS game implement this style of game play so it is doable - just alot there to consider.
  • cbtcbt Member Posts: 644
    Thank you very much rebump but, one last question;

    Everybody is talking about towers and their range etc. like they are already there. I mean, none of the stages will start with towers on them. The user is going to buy them and place them wherever or however they want. Is this possible with GS?
  • rebumprebump Member Posts: 1,058
    It should be since it has been done. You would probably have some of your core logic for tower placement in an invisible tower spawning actor that would handle the detection of user movement amongst the various possible locations a tower could be placed (see the "pads/sites" bullet item in my previous reply above), handling any monetary transactions (i.e. checking for enough money, debiting cost of tower, etc.), and then spawing the tower at the selected open pad/site.
  • rebumprebump Member Posts: 1,058
    In retrospect, the tower spawner could be visible and would be the "placer" actor that the user could move around the game grid and then fire off all those routines already mentioned. A few different ways you could handle that too (drag-n-drop, select new tower and then auto-place when clicked, etc.).
Sign In or Register to comment.