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

#1 2012-10-20 10:59:21

RosesandViolets
New Scratcher
Registered: 2012-10-20
Posts: 4

Help? I can't make my enemy move!

I have a pacman game and the pacman moves fine - but whenever the enemy (it's a crab) moves into a wall, I can't get him to move again!  yikes  Can anybody help me?

Offline

 

#2 2012-10-20 11:02:40

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help? I can't make my enemy move!

RosesandViolets wrote:

I have a pacman game and the pacman moves fine - but whenever the enemy (it's a crab) moves into a wall, I can't get him to move again!  yikes  Can anybody help me?

Have you uploaded it to Scratch and if you have can you post a link?


http://i49.tinypic.com/e84kdj.png

Offline

 

#3 2012-10-20 11:10:06

RosesandViolets
New Scratcher
Registered: 2012-10-20
Posts: 4

Re: Help? I can't make my enemy move!

I haven't because it is an edit of a basic one that I made which I can give you a URL for
http://scratch.mit.edu/projects/RosesandViolets/2843477

Offline

 

#4 2012-10-20 11:14:08

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help? I can't make my enemy move!

RosesandViolets wrote:

I haven't because it is an edit of a basic one that I made which I can give you a URL for
http://scratch.mit.edu/projects/RosesandViolets/2843477

Aha- I have spotted the problem. You have put "if colour is touching another colour" move so when it is not touching that colour and touching the wall colour it will not move!
I'm trying to find someway to fix this but the problem is your sprite is not moving at all in this version so I have to make it move and then sort out the problem

EDIT- by using the "if touching colour" block i have got it to move. Now then- problem fixing time

Last edited by Willpower (2012-10-20 11:15:20)


http://i49.tinypic.com/e84kdj.png

Offline

 

#5 2012-10-20 11:16:15

RosesandViolets
New Scratcher
Registered: 2012-10-20
Posts: 4

Re: Help? I can't make my enemy move!

Okay, thank you  smile

Offline

 

#6 2012-10-20 11:28:05

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help? I can't make my enemy move!

Excuse the awful scratchblocks- you get the idea.

when gf clicked
forever if (touching <color pink>)
move (Speed) steps
if (touching (color purple))
turn <(180 degrees anti-clockwise)>
move (Speed) steps
end
I have got this working!! If you want i could upload it to my test account and you can use it then i can. This Method would be to turn the sprite 180 degrees when it touches purple to make it go in the opposite direction

I guess what you are eventually trying to do is to make the walls solid (i don't know how to do this) in which case you would not need to do all this.

@dvd4- dvd- you usually fix peoples scratchblocks, if you are coming round this way could you help me please!

Last edited by Willpower (2012-10-20 11:31:33)


http://i49.tinypic.com/e84kdj.png

Offline

 

#7 2012-10-20 11:46:53

RosesandViolets
New Scratcher
Registered: 2012-10-20
Posts: 4

Re: Help? I can't make my enemy move!

Thank You! It worked!
big_smile  I'm really happy now  big_smile

Offline

 

#8 2012-10-20 11:48:26

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help? I can't make my enemy move!

RosesandViolets wrote:

Thank You! It worked!
big_smile  I'm really happy now  big_smile

Happy to help  lol


http://i49.tinypic.com/e84kdj.png

Offline

 

#9 2012-10-20 12:05:09

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

Re: Help? I can't make my enemy move!

Willpower wrote:

Excuse the awful scratchblocks- you get the idea.

when gf clicked
forever if (touching color [#f900ff]?)
move (Speed) steps
if (touching color [#8400ff]?)
turn ccw (180) degrees
move (Speed) steps
end

Fixed.


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

Offline

 

#10 2012-10-20 12:27:10

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: Help? I can't make my enemy move!

ErnieParke wrote:

Willpower wrote:

Excuse the awful scratchblocks- you get the idea.

when gf clicked
forever if (touching color [#f900ff]?)
move (Speed) steps
if (touching color [#8400ff]?)
turn ccw (180) degrees
move (Speed) steps
end

Fixed.

Thanks Ernie!


http://i49.tinypic.com/e84kdj.png

Offline

 

#11 2012-10-20 12:33:04

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

Re: Help? I can't make my enemy move!

Willpower wrote:

ErnieParke wrote:

Willpower wrote:

Excuse the awful scratchblocks- you get the idea.

when gf clicked
forever if (touching color [#f900ff]?)
move (Speed) steps
if (touching color [#8400ff]?)
turn ccw (180) degrees
move (Speed) steps
end

Fixed.

Thanks Ernie!

Your welcome!


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

Offline

 

#12 2012-10-23 15:02:51

Red_Ball
Scratcher
Registered: 2011-09-18
Posts: 71

Re: Help? I can't make my enemy move!

you may also want to put an "if on edge, bounce" but to be honest, it really isn't necessary unless you wanted it to be more realistic to the laws of gravity...

Offline

 

#13 2012-10-23 23:54:19

Ideas
Scratcher
Registered: 2012-10-07
Posts: 100+

Re: Help? I can't make my enemy move!

I would do this.

when gf clicked 
forever
move [1] steps
if <key [up v] pressed?>
set [direction v] to [1]
end
if <key [down v] pressed?>
set [direction v] to [2]
end
if <key [left v] pressed?>
set [direction v] to [3]
end
if <key [right v] pressed?>
set [direction v] to [4]
end
if <((direction) = [1])>
point in direction [0]
end
if <((direction) = [2])>
point in direction [180]
end
if <((direction) = [3])>
point in direction [-90]
end
if <((direction) = [4])>
point in direction [90]
end
end


http://img685.imageshack.us/img685/2010/screenshot20121110at132.pngI think that you must CLICK above

Offline

 

#14 2012-10-24 06:45:48

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

Re: Help? I can't make my enemy move!

Ideas wrote:

I would do this.

when gf clicked 
forever
move [1] steps
if <key [up v] pressed?>
set [direction v] to [1]
end
if <key [down v] pressed?>
set [direction v] to [2]
end
if <key [left v] pressed?>
set [direction v] to [3]
end
if <key [right v] pressed?>
set [direction v] to [4]
end
if <(direction) = (1)>
point in direction [0 v]
end
if <(direction) = (2)>
point in direction [180 v]
end
if <(direction) = (3)>
point in direction [-90 v]
end
if <(direction) = (4)>
point in direction [90 v]
end

Fixed.


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

Offline

 

Board footer