Creating a safe place on a play area

ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
edited February 2012 in Working with GS (Mac)
Hi guys

I have created a minefield area which is 320 x 450.

I have a character that walks on screen after a series of mines are placed on the screen.

My question is...how can I tell the random mine generator to not place a mine in a certain area on the screen. The safe area is 100 x 64.

Thank you all in advance :)

It takes a Zombie to know a Zombie!!!

Comments

  • ozboybrianozboybrian PRO Posts: 2,102
    Invisible actors that consist of a boolean that would conflict with your mind placement rule might do the trick.
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    That could work. It how do I add this to the random function?

    I have it so GS places a mine in the area and then -1 off a mine tally attribute. I have it set at 10 mines on the screen.

    How can I tell the random instruction to not place a mine if it hits the invisible actor?

    It takes a Zombie to know a Zombie!!!

  • CloudsClouds Member Posts: 1,599
    "I have created a minefield area which is 0 x 450."

    Are you sure ?
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Sorry that should be 320 x 450 lol :)

    It takes a Zombie to know a Zombie!!!

  • MotherHooseMotherHoose Member Posts: 2,456
    @Tynan=))

    let Spawner just spawn at random

    on Mine:
    Rule: when
    Event: overlaps or collides with safeArea
    --destroy
    Otherwise:
    changeAttribute: game.mineTally To: game.mineTally-1

    (of course … you probably need a rule for colliding on spawn with another mine … destroy … but you don't need the tally reference)

    @Ozyboybrian … please post the: mind placement rule

    @};- MH
  • CloudsClouds Member Posts: 1,599
    There is an easy way of doing ths, no attributes, no collide rules . . . . let me just get to my computer to show you (in bed with bad cold and iPad!).
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    edited February 2012
    Thanks MH, that's great!
    I'll look at implementing that...:)

    Maybe something like - if mine collide with mine, Destroy mine, leave mine talley = mine tally +1 so it performs another random drop.

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Thanks Tynan!

    Hope you feel better soon man. Thanks in advance :)

    It takes a Zombie to know a Zombie!!!

  • CloudsClouds Member Posts: 1,599
    Here's how I would do it . . . simply divide the non-safe area up into rectangular sections . . . . I've just tapped in some arbitrary co-ordinates for the three rectangles I used, but if you were really clever you could extract the X and Y position of a safe area actor (and you already know the size) . . so could dynamically produce the co-ordinates for the random spawning . . . . so in effect you could simply place the safe area where you want it and the spawning would always happen outside of it.

    http://www.mediafire.com/?q9346hpgr64h3jy

  • CloudsClouds Member Posts: 1,599
    "Hope you feel better soon man"

    image
Sign In or Register to comment.