R
RisingKane
Guest
Hi everyone!
I'd like to know if it's possible to call a piece of code (something like a function) of an object from another one. Because I want to make things more organized in my code, and instead of writting it every time I need, I would just have it written in one object, and call it when necessary.
The other thing is, when I click to run my game, my character starts moving on its own. Now, I'm trying to make him stop one tile before a hole in the level, but I've only managed to make him stop in the tile above the hole. I put a picture of what I'm trying to do. The red circle is where I want the character to stop.
Thanks!
I'd like to know if it's possible to call a piece of code (something like a function) of an object from another one. Because I want to make things more organized in my code, and instead of writting it every time I need, I would just have it written in one object, and call it when necessary.
The other thing is, when I click to run my game, my character starts moving on its own. Now, I'm trying to make him stop one tile before a hole in the level, but I've only managed to make him stop in the tile above the hole. I put a picture of what I'm trying to do. The red circle is where I want the character to stop.
Thanks!
Attachments
-
1.3 KB Views: 9