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

#1 2012-04-21 12:12:19

jimmy12384
Scratcher
Registered: 2012-01-18
Posts: 19

help with stamping

I've been making a game where you have to try to swat at all of the flies.I want to make it using as little sprites as possible. help?

Offline

 

#2 2012-04-21 13:44:38

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help with stamping

The difficulty is in detecting if a stamped fly is touching the swatter.  Maybe storing each fly's x and y coordinates in a list and then checking the swatter's distance to every fly every frame?  I just hope you don't have too many flies, as the distance formula will have to be run every frame for every one of them.  hmm


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-04-21 14:29:49

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: help with stamping

If the flies have a constant border color, you can check if the swatter is touching that color.

Offline

 

#4 2012-04-21 14:48:21

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help with stamping

scimonster wrote:

If the flies have a constant border color, you can check if the swatter is touching that color.

But then you'd still need a way to delete them after they die  hmm


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-04-21 15:03:28

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: help with stamping

MoreGamesNow wrote:

scimonster wrote:

If the flies have a constant border color, you can check if the swatter is touching that color.

But then you'd still need a way to delete them after they die  hmm

True...
Then your way might be the best.

Offline

 

#6 2012-04-23 11:19:58

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: help with stamping

Clear all of the flies, and then redraw all of them except for the one that got clreared. I am not COMPLETELY sure how to do this, bu you need to create a list that stores the fly coridinates (sorry for bad spelling). Set the list items to random numbers, then stamp the flies to those list coridinates. Check out chanmanpartyman's 1s1s Archery for the scripts.


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

Board footer