How can i make particles spawn far from the actor?

That is my question, how can i make the particles spawn far from the actor then go in the actor direction?

I can make the particles go from the actor to another actor, but i want to make the opposite:
http://arcade.gamesalad.com/game/109754

Answers

  • caiokawasakicaiokawasaki Member Posts: 68
    anyone?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    If you set the Emitter Offset to a positive value and the Direction to 180 relative to scene, you'll achieve that result.

    Do you know for a fact that the particles in that game are particles and not spawned actors that then gravitate towards the planet?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • caiokawasakicaiokawasaki Member Posts: 68
    Do you know for a fact that the particles in that game are particles and not spawned actors that then gravitate towards the planet?
    I don't know if i understand correctly, but in the game i've posted are spawned actors...
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It looks like the ship is spawning actors that then move toward the planet. What do you need help with?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • caiokawasakicaiokawasaki Member Posts: 68
    It looks like the ship is spawning actors that then move toward the planet. What do you need help with?
    the ship spawn particles, the particles go in direction of the planet, i want to make the particles go to the opposite side, from the planet to the ship...
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Oh sorry, I didn't understand that. When you spawn the particles... we shouldn't call them particles because there is a behavior named Particles and we are not referring to that. When you spawn the rocks (or whatever they are), you'll need to have them head towards the position of the ship. The ship will need to constrain game attributes (e.g. game.shipX and game.shipY, both real) to its own position (self.position.X and self.position.Y). To find out how to make something follow another actor, you might want to watch my video:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • caiokawasakicaiokawasaki Member Posts: 68
    Oh sorry, I didn't understand that. When you spawn the particles... we shouldn't call them particles because there is a behavior named Particles and we are not referring to that. When you spawn the rocks (or whatever they are), you'll need to have them head towards the position of the ship. The ship will need to constrain game attributes (e.g. game.shipX and game.shipY, both real) to its own position (self.position.X and self.position.Y). To find out how to make something follow another actor, you might want to watch my video:

    the problem is: the player will can spawn a lot of ships and them will be in diferent positions... Understand my problem?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yes, I do understand. The only way I know to do that is by constantly updating table cell values to keep track of the X and Y positions of the ships. It's going to be a performance hit on your app for sure. Coding this is not simple. The way I've done it in the past is to have the spawner actor increase a game attribute (e.g. game.shipNumber) each time it spawns a ship. The ship then changes self.shipNumber to game.shipNumber and uses self.shipNumber as its table row number for all table values. It would then (on a timer) change the X and Y table columns for its row so that they are constantly updated. The "rocks" would also change self.shipNumber to game.shipNumber and then follow the X and Y table columns for that same row.

    Phew. I think I have a demo that will help. It uses this same system to keep track of an enemy's position for a health bar, but you could adapt it to follow the enemy instead. I made the demo, so let me know if you have questions.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • caiokawasakicaiokawasaki Member Posts: 68
    edited February 2013
    Yes, I do understand ... u have questions.
    When i execute your demo, i think the gamesalad find some bugs, because i just see 3 red boxes going up and down...
    But for now, i just gonna forget the "details" and focus in the the game operating...
    I really appreciate your attention in trying to help me...

    EDIT: I have another question... if i have a lot of actors with the tag="ship", and i create the same rules to all these actors, when any of the ships collide with another ship actor can i make both ships shot(spawn bullets actors) in direction of the collided ship?
    I'm talking about something like 50 or more ships...
    I hope that does not sound confusing...

    Thanks, Caio
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    You should see white boxes going across the screen with blue health bars on top, and then red boxes going up and down.

    image

    With regard to your question, are you saying that any time two ships collide you want the bullets/rocks from both ships to go towards one of the ships? I guess I don't understand.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • caiokawasakicaiokawasaki Member Posts: 68
    You should see white boxes going across the screen with blue health bars on top, and then red boxes going up and down.

    image

    With regard to your question, are you saying that any time two ships collide you want the bullets/rocks from both ships to go towards one of the ships? I guess I don't understand.
    Yeah, basicaly that... I'm creating a strategy game, something like age of empires, empire earth, and i need to create sometype of war in the game... and i need to make the ships battle, but will be a lot of them, something like 50 or more... and i need to make when my ships collide with the enemy ships both attack one each other...
Sign In or Register to comment.