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

2021/9/21

getNeighbours

Tuffel Tuffel

2021/9/21

#
i want to check, if a certain actor is around me, and if it is, trigger a reaction. My main Problem is, how do i say which actor? The documentation said its this: "java.lang.Class", but idk what it is, pls help
eagcon1 eagcon1

2021/9/22

#
Well I just started but can you specify the name of the actor
eagcon1 eagcon1

2021/9/22

#
IDK if that doesn't work (I'll try to solve it)
Tuffel Tuffel

2021/9/22

#
The Name of the actor that should trigger the act is Kraftfahrzeug, and the actor that should be around this actor is Tankstelle
Roshan123 Roshan123

2021/9/22

#
if(!getNeighbours(50, true, Tankstelle.class).isEmpty() ) //trigger Or import java.util.List; List<Tanksettle> ts= getNeighbours (50, true, Tanksettle.class) ; if(ts.size()! = 0 ) Get out from the class else get in
You need to login to post a reply.