I've just started to read and learn the BYOND language and I am currently working on a mini project to help me better understand BYOND coding.
anyways, I have been trying to find a way to make the user mob to not be in the center of the screen but elsewhere (on the bottom of the screen for example), how can I do this?
And how do I make it so that the screen doesn't move while the user mob moves around?
Also:
Code:
atom
proc/Bumped(mob/M)
dir = turn(ball.dir,180)
return
why is this an error?
PS: I'm trying to make a simple game of bricks
PSS: sorry for being a super noob
As fgor your snippet, several things;
Most likely it's giving an indendation error. This is because you put your 'return' statement an indent higher than your other line (dir = ..), while they're both on the same level (working inside of Bump())
Now, your Bumped proc right now is not doing what it should do.
You've specified the atom it bumps into as mob/M, but there is no guarantee it actually will be a /mob , you're just referring to it as such. If you try to, say, output the mob's client, and you bump into a tree or whatever has density, you'll get a runtime error.
Also, let me presume the 'ball' is the thing that should be turning, while your Bumped() is defined for every atom.
Keeping in mind both remarks, this would be the way I'd handle it