Attaching shadows

HawtSawceHawtSawce Member Posts: 42
edited November -1 in Working with GS (Mac)
Anyone have a tip for creating shadow actors attached to other actors? I am able to do it with an initially placed actor on the stage but not a spawned actor.

In theory it should work like a parent/child scenario but I don't think GS allows children to see the parents without global variables set?

Ideally I want to spawn in the parents and have the parents spawn their shadow actor children without relying on global variables.

Thanks.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    It's a pain to be honest, and without using global attributes, you would need to use Instance to Instance communication to pull it off.

    Before we discuss solutions though, just be aware that shadow Actors will kill the processor because they require Constrains to work. Each shadow will need between 1 and 3 constrains. You will have to constrain the X position, the Y position, and the Rotation of the "parent".

    If you are only targeting the iPad or the iPhone4, you might be able to get away with it. But even just one shadow on one actor will kill the FPS of an older device.

    If it is necessary for the gameplay - like the shadow in Zaxxon to determine the ship's height - that's one thing. But if it is just for aesthetic reasons, I highly advise against it. The older devices simply cannot handle it.

    I have a shadow on an Actor like that in my current game, but there is nothing else going on in the Scene.

    You say that you have a shadow working, have you tested it on an older device?
  • HawtSawceHawtSawce Member Posts: 42
    Sounds reasonable. Which is more work for the processor: A few bytes of shadow constrained to an actor? Or the constrain functions themselves?

    I am assuming the constrains are the issue and not neccessarily the file size granted the file size is reasonable.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Yeah, it's just the Constrain Attributes. They constantly run and bring the system down. Use them sparingly.
  • HawtSawceHawtSawce Member Posts: 42
    Since you're up :) Perhaps you can help me solve another issue. You helped me out on this one before but the scenario is different now.

    Before I needed to shoot at mouse pointer while scrolling the background. You gave me advice and it worked. The formula was vectoangle((mouse.x+cam.x)-self.x,(mouse.Y + cam.Y)-self.y)

    Oddly enough I can't use this formula to rotate to the player during scrolling. Basically I replaced the mouse.x and y with the player.x and y global constraint variables. It works in the initial screen but as soon as I scroll its done for. Help on that would be much appreciated :)
Sign In or Register to comment.