Quadrophobia: State of the quad

So – made some more progress today.

Implemented a Reload icon/button.  Works when clicking it.  Will have to try on my tablet.  In theory it should work fine, but you know how things go.

I also implemented the “falling stars”.  Though no trails, just applying gravity.  I messed around a bit with trails tonight and I don’t think I like how it looks.

So that’s 2 more things off the “to do” list.  Now that I have the ability to count how many moves I’ve made, drop the stars if I’ve gone beyond that number of moves, and reload the scene, I’ll either have an auto-reload or the ability for the player to select to reload or to move one (if they can).

Looking at it now, of course, the problem with a gravity effect when you pass the threshold (i.e. the lowest star falls offscreen if your number of moves go beyond that value (so instead of 3 stars, you’d get 2 for that level))… The problem is that gravity takes time.  Since it takes time, when you go to the next level, it instantly goes there, and if, say the value to hit was 5, and you had 6 moves, the 5 would start to fall offscreen, but then you’d hit the portal and BAM  next level… the falling didn’t complete.

Now – I can wait to load level until any falling has finished.  It’s going to take some learninatin’ however, because AFAICT there is no easy way to tell if a UI element is visible on camera or not.  With mesh renderers in the unity engine there is a boolean “isVisible” which can tell you whether or not the object is visible on screen.  I think the assumption is a UI element will be on screen cuz, UI.  But if you’re doing a transition effect.

I suppose a second way to do this would be to implement an animation (and probably what they really want a developer to do).  In that case, you would animate, and I’m sure there’s an “isAnimationFinished” boolean you could check.  So of course that means I’m going to have to redo all the work I did today.

The other option is to do some sort of tween effect, like a fade (I did try that on the star image, but since that applies only to the image, not the child text, it didn’t get rid of the value listed on the star).  That’s what I use to make the “Player Has a Key” icon, just an instant fade-in.  I do have iTween installed, and since there’s a way to tell if the tween still in process, that might be one way to check for a transition.  If I do that, I’d probably just do a fade-out of the stars.  Though I suppose I could just apply a falling effect manually (instead of using the built in gravity).

I’m sure part of it is the fact I’m applying gravity to a UI element, though since it’s not off limits, why the fuck not?

It’s kind of a bummer.  I know any system will have its weird limitations, but sometimes things seem like they should just work like you want.  But it never is the case.  Sometimes that’s due to the need to architect a program a specific way (that is, if you add a feature you think is “obvious” it might interfere with the implementation of another feature).  Other times it’s due to the developer having a different vision of the software, or it might be that it takes too much time to implement that feature in the way you think it should be done, and they’d rather work on some other feature.

There’s always a million different reasons a program might not work the way you want it to.  And of course, that’s a generic issue, not just an issue for game developers and coding.  Anytime a human interacts with a computer, they are, by design, interacting in one specific solution design, and therefore, not the other.  This means that you are always constrained by the vision of the programmer, the systems available (whether it be hardware, or language features, etc…), that’s not even accounting for money/time which is another HUGE issue on development, of course.

On the one hand I’m bummed that I may have to redo what I did today, but on the other, failure is just one more route to learning and understanding something better.

This might not be an issue if I animate the scene transitions (which I generally plan to do at some point).  If I zoom the camera in after entering a portal, the items on screen would get bigger, but still be animating, and thus, falling off screen, instead of an instant shift to the new level.  So that’s one possibility then I wouldn’t have to redo anything or check for whether a star/value is visible before moving on.  I may just use a camera animation then.  Of course, I still have to learn how to do it, but I think it could work.  AND it’s more dynamic since you’ll be having vertical (y-axis) motion of the star(s) and zoom motion (z-axis) of the camera…

Leave a Reply

Your email address will not be published. Required fields are marked *