Controlling camera woes... need assistance

lildragnlildragn Member Posts: 105
edited November -1 in Working with GS (Mac)
Hiya, I've done a google search on this topic and came up with some interesting threads but none have worked so far for me. I've been at this for two nights now and I would love some help.

Here's what I'm trying to do.

- two screens are setup [ | ]
- Player shoots arrow from one side of the screen
- arrow travels and cam follows to other screen
- once the arrow collision is detected send the cam back to it's origin (gradually, not pop back)

I've exhausted every option I can find and currently I created a camFollow boolean which is switching correctly through rules (using display text to debug) and I have a camTracker actor on the stage that's being constrained by the arrow when it spawns. The issue is I can't send the cam back successfully, it appears to stay constrained to the arrow's X.
Any help would be appreciated. Hard to put in words, but any idea/templates I can look at would be appreciated.

thx!

~t

Comments

  • lildragnlildragn Member Posts: 105
    Anyone? Would love some help here.

    Cheers!
  • Rob2Rob2 Member Posts: 2,402
    Maybe have a look cannon physics, sounds like that has the camera functionality you need.
  • arcticsunrisearcticsunrise Member Posts: 159
    its a tad tricky - i used the canon physics as a starter but this returns camera to origin on touch rather than after the item has been destroyed

    for my game - http://itunes.apple.com/us/app/splatt/id470602397?ls=1&mt=8 - i used scene settings within prototype actors plus a combo of the settings in canon physics to get this to work.

    look at camera.origin.x / y within scene properties within your arrow
  • lildragnlildragn Member Posts: 105
    Hmm I'll have a look at the canon physics tonight. It's strange this doesn't work the way you imagined it... I didn't even add in another layer of having the user pan to the other side of the screen to check position on the enemy character :) Just gotta get this locked down first, because the game idea revolves around the cam mechanic.

    thx guys.

    artic, would you mind putting something quickly together? Just squares and the rules would be awesome. I'm sure it'll be beneficial to others as well.

    ~t
  • arcticsunrisearcticsunrise Member Posts: 159
    if i find time ill def razz something up - tbh im fairly new to gs and have used my previous programming and games making experience alongisde my generative art coding which gives logical and maths knowledge to help me
  • lildragnlildragn Member Posts: 105
    Hey artic, that's cool, let's just say you're still in a much better position that me :)

    Also I took a look at the Cannon Physics demo, and it's actually what I currently have which is not very elegant, because once you click to return, the ball is already charging but it snaps back to the origin :( ,. I know this has to be possible, I'll bang my head a lil more here to see what I can do.

    ~t
  • Rob2Rob2 Member Posts: 2,402
    You need to be looking at unlocked actors accessing the camera directly in the scene if you want more elaborate camera control.

    image
  • lildragnlildragn Member Posts: 105
    Ah cheers Rob2, you gave me something new to try :)

    thx

    ~t
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Since the camera is already locked to the arrow -- how about setting the arrow's alpha to 0 and interpolating it back to the starting point. Will the camera follow? Then when ready for another shot, bring the arrow's alpha back to 1.
  • lildragnlildragn Member Posts: 105
    that would definitely work, but that limits me to 1 arrow on the screen at a time right?. I want to have the effect where a few arrows are stuck in a character/wall e.t.c and destroys overtime. I honestly can't believe how tricky this is :)

    Once an actor is constrained, can that constraint be broken?

    ~t
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    lildragn said:Once an actor is constrained, can that constraint be broken
    OK -- in the spawned arrow, have you tried to constrain the camera to the arrow _only_ when the 'camFollow' boolean is 'true'? When 'camFollow' is not true, interpolate the camera (or your camTracker actor) back to its origin.

    or. . .

    Since the camera is already following the arrow. How about doing the alpha to 0 trick (as described previously). And spawning a new different arrow at the point of impact. This new arrow would look the same but actually have different behaviors in it (sticks to character/wall, and destroys over time.)
  • lildragnlildragn Member Posts: 105
    Hiya RThurman, just to let you know I got things going! Thx much for everyone's help here.

    So as I stated in another thread I put up a demo demonstrating what we spoke about here.

    Search for Beyond the Basics in the New section of the launchpad and it should pop up or go here http://gamesalad.com/game/45386

    Getting that fireworks cheer felt good :) But for some reason though the publishing part of the app didn't allow me to choose the 512 image, they were all greyed out.

    ~t
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Hey! Its really coming along nicely!

    Here is a suggestion. In the arrow's move rule, replace both the 'rotation' and the 'change attribute (self.rotation)' behaviors with the following behavior:

    Constrain Attribute: self.rotation To: vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

    This will make the arrow's rotation match its trajectory and fly realistically through the air.
  • lildragnlildragn Member Posts: 105
    You rock! Will do that next. Thx man

    [Edit] Just tried it, and it works like a charm, just what it needed... thx again!

    ~t
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    lildragn said:
    Just tried it, and it works like a charm, just what it needed... thx again!

    You are welcome! Looking forward to the finished game.
Sign In or Register to comment.