Spawning a hitbox actor on top of a randomly spawned actor
Hey guys! I've got an enemy hitbox actor that "approaches" the screen by getting larger. I would like those randomly placed around on my screen, which is working perfectly fine. However, I want a different actor to spawn on top of it and be attached to it every time.
Basically it's like a rock flying toward the screen, but only the the very bottom of the rock works as a hit box. So I don't want anything to happen if the rest of the rock is touched, but the bottom of the rock causes things to happen. I figure I'll do all the controlling of the rock through the hit box actor, and just have the rock follow it, but I'm not sure how to make the rock follow it if it's randomly put on the screen somewhere.
Maybe I could make it so that when the hitbox is spawned, it spawns the other actor on top of itself at blah blah coordinates? I'm not sure how to then make that instance of the actor stay stuck to that instance of the hitbox. It would be nice if I could just spawn a group of sprites sitting in a certain way, but I don't know of a way to do that.
This seemingly simple thing is a little tough, so any help would be appreciated!
Comments
My health bar demo does exactly this: http://forums.gamesalad.com/discussion/comment/384027/#Comment_384027.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
That looks like it'll be perfect! I'll study it a bit. I haven't used tables before so I'll have to figure that stuff out.
Thanks a lot!
Vote for Nearest Neighbor Scaling option in gamesalad! Let's make our games look truly stunning!
Awesome, totally worked. Tables took a moment to get my head around but it turned out awesome. Everything in game programming seems to be just various elaborate forms of referencing. Thanks again! I thought this was going to be the death of my game haha
Vote for Nearest Neighbor Scaling option in gamesalad! Let's make our games look truly stunning!
You're welcome! That Spare Code thread has a lot of gems in it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User