This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-14 16:25:34

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

-Infinity?

I'm working on a game and I have variables for x and y that moves the character. I have 2 scripts, one to set the x variable to 0 when the flag is clicked, and one to set the y variable to 0 when the flag is  clicked. For some reason the y variable sets to -infinity every time. I didn't even know that was possible, I've never seen it before. Does anyone know why that could be happening?

Offline

 

#2 2013-02-14 16:47:28

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: -Infinity?

dankill51 wrote:

I'm working on a game and I have variables for x and y that moves the character. I have 2 scripts, one to set the x variable to 0 when the flag is clicked, and one to set the y variable to 0 when the flag is  clicked. For some reason the y variable sets to -infinity every time. I didn't even know that was possible, I've never seen it before. Does anyone know why that could be happening?

To make sure, do you have the center of your sprite on it or off to the side? If you don't know how to check, just open the costume in question in the Paint Editor and click the little button with a + on it.

Last edited by ErnieParke (2013-02-14 16:47:37)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-02-14 16:55:07

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Re: -Infinity?

Well it's a scrolling game so the sprite stays in place. The x and y variables move the background sprites

Offline

 

Board footer