Studdering issue

The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
edited December 2011 in Working with GS (Mac)
Okay, so I'm back to work on my tank game. I have a two piece tank with a bottom and turret, my X & Y reporting attributes are at the top of my logic and are reporting every .001 seconds. When I move forward the turret jogs back and forth like it's not reading the report at the right time to keep up. My turret is looking to the report at the same rate of .001 and is also at the top of my logic. Anyone have any ideas? I am using an integer but would it be better if I used a real attribute? If I stretch the camera out it seems to elevate the amount of jog. I'm not the type to blame GS for every problem and I know this has been discussed as a GS issue, if so could we get a fix or acknowledgement of this issue?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Because I dont know the answer, let me ask you this..Would it hurt to try a real attribute? It might solve the problem right?
    Go for it.
    Sorry I can't help more.
    Bray
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited December 2011
    Yeah, I'm going to give it a try but thought I might ask before I screw with it.
  • MotherHooseMotherHoose Member Posts: 2,456
    believe it is best to always use Real-type attributes for elements in the display that a computer continuously/constantly/consistently monitors/tracks as real.
    at any given time an X or Y attribute can be at fractional/decimal locations … the computer tracks those fractions.
    using integers for your elements movements, is no doubt causing some of the stuttering.

    another possible cause may be the hundredths of a second Timers that access those attributes.

    you do not need timers … you do not need to monitor the tank's position
    Simply:
    On your turretActor use 2 Constrain Attribute behaviors;
    1. constrainAttribute: [exp] self.Position.X To: [exp] Current Scene> layers> correctLayer > tank.Position.X
    2. constrainAttribute: [exp] self.Position.Y To: [exp] scene.layer.tank.Position.Y+(scene.layer.tank.Size.Height /2) +10
    and adjust that '10' to whatever gives you the correct look for the turret atop the tank
    get rid of the timers … get rid of the attributes that reference the tank's X,Y

    if you still have stuttering, then check the data on your images.

    Good Luck!
    MH
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Thanx MotherHoose I'm going to do that now.
Sign In or Register to comment.