Spawn actor then move to place and spawn another - Help.

Im trying to build a basic game for students in my class with autism which is based around grouping animals.
I have managed to set up a random spawner for my animals but i would like it to spawn one until the animal has been moved into the correct pen/cage, then spawn another.

I have managed to get it to spawn to where i would like it to and I can move the animal by touch.....

So my question is

1) how do i limit my spawner to 1 random animal on screen untill it has been placed in the correct pen/cage
2) I also want to limit the game to 10 animals

Any help or tutorials would be greatly appreciated and apologies if im not using the correct terminology

Reagrds

:smiley:

Comments

  • ArmellineArmelline Member, PRO Posts: 5,369

    Take a look at the attached project.

    Essentially you just need to keep two counts - the number of animals that have been spawned, and the number of animals successfully put into their pens. When they are equal, spawn another animal. When the spawn count reaches 10, stop spawning.

    The attached project shows this very roughly. If you have any specific questions about what it's doing just ask.

    Note that I made no real effort to make the "penning" of the animals work more than vaguely. It wasn't necessary for the purposes of this example.

  • mrwengermrwenger Member Posts: 4

    Thank you for file, its helped me understand how it works apart from a couple of things.

    1) When changing the attribute to self.type I cannot find type under the attributes browser?

    Also, under animal change attribute self.color.red self.color.green etc there are corresponding numerical values what does all this mean?

    I did a screen grab but have no idea how i can post into my reply.

    Thanks

  • ArmellineArmelline Member, PRO Posts: 5,369

    @mrwenger said:
    1) When changing the attribute to self.type I cannot find type under the attributes browser?

    self.Type is just a self attribute I made - you do that by going into the actor prototype and clicking the + under the attribute pane.

    Also, under animal change attribute self.color.red self.color.green etc there are corresponding numerical values what does all this mean?

    I didn't have images for the animals, so I just used colours, and these change attributes are setting the colours. If you go to the actor attributes pane there is an option for colour. If you expand that option you'll see Red, Blue, Green and Alpha values that you can set. If you're using graphics for your animals you can ignore that part of the logic.

  • mrwengermrwenger Member Posts: 4

    Armelline what type of attribute should i select, integer etc

    Thank you

  • mrwengermrwenger Member Posts: 4

    Dont worry I found it. :)

Sign In or Register to comment.