Couple more questions, :P
Kamazar
Member Posts: 287
I set up a couple attributes that tracks the position for a door for a couple NPC actors to accelerate towards. Apparently, since the screen wraps, they decided just going to the left instead of to the right would be quicker. So I had the screen wrap attributes set to false. But now, they bravely venture off into a mysterious abyss of which there is no return. I can't set-up (ugly and annoying) invisible walls because they'd still accelerate in the same direction. Shouldn't no screen wrap mean that all the actors are confined to the playing field?
1) How can I get them to accelerate towards the door the way I want them to, moving to the right instead of the left wrapping to the right.
2) Can I do away with the wrapping altogether so that actors just bounce of the way? I've thought about changing X and Y velocities to 0, but that takes away any bounce.
1) How can I get them to accelerate towards the door the way I want them to, moving to the right instead of the left wrapping to the right.
2) Can I do away with the wrapping altogether so that actors just bounce of the way? I've thought about changing X and Y velocities to 0, but that takes away any bounce.
Comments
hey k, are you using a static scene, meaning is everything in the window scene? if so, and this may sound corny, but, you could just extend the size of the scene outside the window, on side you don't want them to go. that way, the shorter distance will be the direction you want them to take.
i admit, it's a hacky solution, but it might work. til you find something better.
I thought it would just be simple enough to add an actor, make it non-movable, add and resize 4 of them as a frame around the camera view, and give any actor that needs them the collide behavior to hit the wall.
We are fortunate to have the tools we have so early in GS life cycle. Rather than burning oxygen on what isn't there - I'd hope the GS folks focus on getting the commercial version ready. We can all look forward to new features later.
i'm afraid i stand on both sides of the fence here...yeah, i know, so brave. i agree with jhaas and kt that we are fortunate to be in on the ground floor of such a great and potentialy profitable piece of software.
but, my ocd heart is with kamazar. especially, because this app has not yet reached maturity, as it's version number would indicate, it's in our best interest to optimize any way we can, and to teach others who don't even realize what optimizing is, how it can benefit them. and since they hope to attract novice as well as experienced programmers, these types of issues are going to get brought up and hopefully hammered out over time.
i am most glad that codemonkey asked the question that he did. it shows that they are paying attention to us and seeking our thoughts as developers, wether we be novices or not. that is encouraging to me.
i hope to see us all make each other better. and i hope to hear of the app store success story of someone from this forum, whom i can tell people in the future," yeah, i knew them way back when..."
So because they are moving away from the door, it is not that they are accelerating towards the door and using the shorter wrap screen direction to get to it(its not that smart without adding behaviors/rules to do that on its own), it is more that the acceleration you gave it was not enough to overcome the velocity to stop it from passing the wrapping border and accelerating the door.
So you could give your NPCs the rule that if their position is greater/less than or equal to some numbers representing just inside of the borders of your view, then to change its linear velocity to 0.
That's my guess.