#need help with basic stuff

30 messages · Page 1 of 1 (latest)

mossy dew
#

Thanks for your question :clap:, if someone gives you an answer it would be great if you thanked them with a :white_check_mark: in response. This response will earn you both points for special roles on this server.

mossy dew
#

can you give us the code for the cherry and the code of the gate?

#
Actor gate = getOneIntersectingObject(Gate.class);
#

ig

#

you are getting Cherry.class for both variables

#

OK do what i said ^^^

#

hmm then there is a problem with your gate

#

you sure it's named Gate maybe gate

#

you are just removing cherry twice

#

maybe MazeGate

#

hmm idk in greenfot but here Gate doesn't have a texture

#

as I told you you are just removing cherry twice

#

can you give cherry code

#

also here you don't have {} which means it will always remove without printing the code here is really is
if(Cherry! = null) do print("ksoso")
RemoveGate()

#

yes they shouldn't for now but keep them so no bugs happen

#

where is the public Cherry how does a cherry knows it's texture

#

OK can you do

Actor gate = getOneIntersectingObject(Gate);

without the.class part

#

if didn't work do same thing but with .class and make sure Gate is capital

#

wdym

mossy dew
#

make it

getWorld().removeObject(gate);
#

or name the variable Gate

mossy dew
#

does the cherry gets removed?

robust spruce
#

did you change "Gate" to "gate" in the second if statement from the last screenshot you sent?

#

oh lol

#

oh bruh the post was made 1 month ago

#

im completely not late

mossy dew
#

what was the problem tho (if you have time)

#

oh tho dumb me you are doing if Cherry! = null twice even in gate case
maybe the cherry gets set to null when it's removed so the if statement never gets executed

wheat cloud
#

Yeah