It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, guys. Sorry for noob questions from me, but whats wrong in this piece of code?
Fishes = class()
function Fishes:init()
-- you can accept and set parameters here
self.fish = physics.body(CIRCLE,20)
self.fish.x = 100
self.fish.y = 0
end
function Fishes:draw()
ellipse(self.fish.x,self.fish.y,40) -- this string makes codea unhappy
end
function Fishes:touched(touch)
-- Codea does not automatically call this method
end
I expect codea dont like this values : "self.fish.x and self.fish.x"
Comments
works fine for me
i assume you wrote
instead of
@Jvm38 Im foregin and sometimes i understand your advices like slowpoke,but what you mean?
i suppose you made a typo mistake when calling the draw().
This is very common when you begin with lua...
@Jvm38 no. I understand this. But problem in something else
then post the whole code, what you have posted works fine.
btw, what do you mean 'makes codea unhappy'? can you post the error text?
PS: sorry for my short answers, i hope you dont feel this as rudeness. I just try to be quick and concise.
@Jvm38
this makes no sense:
Fishes is a class, not an instance of the class, you must create and draw one sample fish1 or more:
@Jvm38 thank you very much