Hey guys, I don't know if this is possible or not but what I'd like to do is everytime an enemy active object is created, I want to have a separate active object follow him around underneath him for a shadow. I've done this successfully with the main hero character, but the problem is how can you make sure that ALL the shadows won't follow the same enemy instead of one for each?
If it has something to do with the spread value I'm afraid I don't really get it. I know arrays really well though, could I do it using an array?
Thanks!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Uh, I suppose it's possible to do with an array, but that'd be serious overkill. I don't feel like explaining spread values, so if you can't do that just have a counter that is incremented every time an enemy is created and set some alterable value of both the enemy and the shadow object to its current value when they appear. Then use those values for your object focus.
I'll have to try that out Axel. Yeah, sorry about being a total spread value n00b Radix, I don't blame ya. I tried to do something with spread values before but it didn't work out so hot.
If I didn't need to distinguish flying enemies from ground ones I wouldn't put the shadows in at all, by giving them some transparency (which is why I need the secondary object instead of just drawing it as part of the enemy's sprite) it looks more realistic. Of course, nothing else in the game looks realistic, so maybe drawing them in solid isn't such a bad idea afterall.
Thanks for your replies!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
When you create the enemy, create a shadow aswell
then just always position the shadow at the enemy
as long as there is as many shadows as enemies they should be positioned one per enemy
Pretty inefficient way of doing things though.
Spreading values is probably the best way - easy to do, plus you're not always destroying and creating new objects. I'm not sure - I would have thought that creating and destroying objects every single split of a second would cause some performance problems on crappy computers. Whereas I am fairly sure you wouldn't have a single problem with spreading values.
Also spreading values allows you to destroy both the object and shadow together, as well as changing animation and stuff. It can be pretty buggy if you do these things using Axel's method.
Use the Spread Values command for some random Alterable Value for both your shadows and enemies. Then, use a fastloop to position the shadow with its corresponding enemy.
I believe Ben Mercer has a shadow engine, or you can use this one: http://www.klik-me.com/KMv2/article.asp?id=24 if you need any help.
As for the Spread Value command: think of it like assigning each object an ID. The first object's alterable value is the initial value (usually 0), the second object's alterable value is the initial value plus one, and so on. Remember to respread the alterable value whenever you create or destroy an object.
Really, you can use whatever you like. I know that it sounds crazy, creating and destroying a lot of objects 50 times per second, but I've never had any problems with it, so what can be so wrong about it?
Now, the exact same thing, but with spread a value/fastloop. It's CCA because I don't have fastloop on my TGF:
I tested shadowexample.gam with 200 smiley-objects; no problems and no slowdown at all. Will you have 200+ flying enemies on screen at the same time in your game, Del Duio?