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

#1 2012-07-23 23:52:32

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

city tycoon

im making a simple city tycoon and i have grass and a house button and when you click the house button you can click the grass and it becomes a house then people move in i need when you mouse over it but dont click it turns into a preview of a house

Last edited by ZombieHappines (2012-07-23 23:54:36)


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#2 2012-07-24 00:20:58

hunter6690
Scratcher
Registered: 2012-05-12
Posts: 36

Re: city tycoon

the script is...

when clicked
forever
if
touching mouse-pointer v
switch to costume
your house preview costume
else
switch to costume
your grass texture

Last edited by hunter6690 (2012-07-24 00:24:17)

Offline

 

#3 2012-07-24 00:38:55

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: city tycoon

that's almost exactly what I would do, it works


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#4 2012-07-24 01:30:12

hunter6690
Scratcher
Registered: 2012-05-12
Posts: 36

Re: city tycoon

bullelk12 wrote:

that's almost exactly what I would do, it works

Yep i used it in muh OS about 8 times

Offline

 

#5 2012-07-24 12:15:51

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Re: city tycoon

hunter6690 wrote:

the script is...

when clicked
forever
if
touching mouse-pointer v
switch to costume
your house preview costume
else
switch to costume
your grass texture

i want to click the house button then it previews so i have the house button when clicked broadcast house and this is what i have for the grass

when i receive house
forever
if
touching mouse-pointer v
switch to costume
house
else
switch to costume
grass

and this doesnt work because it doesnt turn off when i click to buy the house so it turns back to grass when i move the mouse away

Last edited by ZombieHappines (2012-07-24 12:16:42)


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#6 2012-07-26 21:24:05

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

Re: city tycoon

I would like to look at your project and help you with that, but from what I can see, the problem with the script is that if the sprite isn't being touched by the mouse pointer, it will automatically turn into the grass costume, causing this glitch.

When clicked
forever
if
touching
mouse pointer
?
switch to costume
preview of house
show
if
touching
mouse pointer
?
and
mouse down?
switch to costume
bought house
show
end script
if
not
touching
mouse pointer
?
hide

I hope that this script helps!

Last edited by ErnieParke (2012-07-27 10:18:30)


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

Offline

 

Board footer