220 and 220.0 is not the same

HunnenkoenigHunnenkoenig Member Posts: 1,173
edited November -1 in Tech Support
I am trying to do here something, which is based on coordinates and I read and write them and I just experienced that 220 is not the same as 220.0

If the value is 220.0 (spawning point), my actor doesn't do, what it should. As soon as I do something with it and it returns to his original position and his value changes to 220, it does, what it should do.

EDIT:

It was just a "bug report" but I have found the "floor" function in the express editor :-)

Although, it doesn't do anything in my case....

EDIT2:
floor(220.0) is 219...
Hm...

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    I can't reproduce that issue of floor(220.0) being 219.

    Is there something else you do to test that? I just do a Display Text of floor(220.0)
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Sorry, probably it was my fault with 219, because I spawned an actor relative to another actor in -65 position.

    The thing is:

    I have an icon 49x49
    this icon spawns the same icon -65 relative to actor on the Y axis.

    I needed this second actor's y coordinate and I used display text.
    After spawning it, it told me 220.0

    then I used change positionY to floor(self.positionY) and then I got 219.

    I believe, that was, what I did.

    I also messed around with the -65 and tried -65,5 and -64,5 and I think by one of them is then the 219 happened.

    I managed to work around, but I will check again, if it is needed.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I have heard that GS doesn't so well with images and actors that have an odd dimension.

    not sure if that is the problem here. Something to try though.
  • design219design219 Member Posts: 2,273
    Does anybody else have no clue as to what "floor" is?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    it rounds down I believe. So I think floor(10.9) = 10 and ceiling(10.1) = 11

    not totally sure though
  • design219design219 Member Posts: 2,273
    Ah, thanks. I feel smarter now!
  • firemaplegamesfiremaplegames Member Posts: 3,211
    there's also "ceil" as well... which rounds up.

    @Hunn: if you have graphics that have an odd dimension, i.e 49x49, they will be blurry.

    I would make them 50x50, or 48x48.

    Because GS centers everything, that odd pixel will get split, and cause a blur.
Sign In or Register to comment.