This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kokoro
Kokoro wrote ...

2017/2/9

Solid objects..

Kokoro Kokoro

2017/2/9

#
Any idea like making some solid objects? A simple coed i would wish..
danpost danpost

2017/2/9

#
Kokoro wrote...
Any idea like making some solid objects? A simple coed i would wish..
Something like this:
1
2
3
4
5
6
// with field
private int speed = 3;
 
// in act
move(speed);
if (isTouching(Actor.class)) move(-speed);
You can be more specific with the type of Actor object if needed.
Kokoro Kokoro

2017/2/9

#
Again i use that zombie demo shooter you made... So i'm aiming for some objects which "player" cannot pass by through them like some and also the size to be by the picture size... "actor class" Objects it has next subclasses "cactus" "rock" "house"
Super_Hippo Super_Hippo

2017/2/9

#
Did you try his code? Change 'Actor.class' to the class you want to be unpassable and report back if that is what you wanted.
Kokoro Kokoro

2017/2/10

#
Nope is not solid..
Super_Hippo Super_Hippo

2017/2/11

#
Show what you have tried.
You need to login to post a reply.