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

#1 2010-07-15 14:53:25

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

I need help with mouse + costume!

I need my sprite to change costume depending on the x and y position he is in.

Offline

 

#2 2010-07-15 14:57:15

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: I need help with mouse + costume!

Well, how do you want it to change?

You could do this:

Code:

switch to costume ((x position + 240) / 10)

That would set the costume in accordance to what the x position only is, and it'll change after every ten pixels of movement with the mouse. But it doesn't account for y position - how would you like it to work? Something like a grid, and if the mouse is in a particular square the costume changes?

Offline

 

#3 2010-07-15 15:03:35

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: I need help with mouse + costume!

Yep, exactly that would help!

God 600 seconds is ages!

Offline

 

#4 2010-07-15 15:06:16

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: I need help with mouse + costume!

Gveradux wrote:

Yep, exactly that would help!

Exactly my script, or exactly the script I may be able to make with the grid?

Sorry - I'm in a very loud room and it's quite difficult to concentrate.

Offline

 

#5 2010-07-15 15:33:04

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: I need help with mouse + costume!

Gveradux wrote:

Yep, exactly that would help!

God 600 seconds is ages!

300 seconds = 5 minutes.
600 seconds = 10 minutes.


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#6 2010-07-15 16:49:53

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: I need help with mouse + costume!

Sunrise-Moon wrote:

Gveradux wrote:

Yep, exactly that would help!

God 600 seconds is ages!

300 seconds = 5 minutes.
600 seconds = 10 minutes.

I think he mean 60 seconds. you know the rule???

Offline

 

#7 2010-07-15 16:58:03

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: I need help with mouse + costume!

laser100 wrote:

Sunrise-Moon wrote:

Gveradux wrote:

Yep, exactly that would help!

God 600 seconds is ages!

300 seconds = 5 minutes.
600 seconds = 10 minutes.

I think he mean 60 seconds. you know the rule???

He's a new scratcher.

For your problem, how many costumes are there? A lot, or only a few? If there's only a few, you could use a bunch of if statements.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer