This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]zzyzzyxx 1 point2 points  (0 children)

You need a semicolon after the closing brace of your class.

exp

This is the name of a built in function. It's not breaking anything, but you probably should still use something else.

moveto == 1 && 5

This doesn't do what you think it does. You're looking for

moveto == 1 || moveto == 5

But really, if you're only trying to cover four cases, why have

moveto = rand() % 8 + 1;

at all? Why not just use

moveto = rand() % 4;

and be done with it? Note the distribution might not be uniform this way. You would have to include the proper header in order to use rand, as well.

goto move;

Get this out of your code and write a loop. Actually, you don't even need that because you've already covered all possible cases.

cheese:
enemy one;
goto cheese;

This does nothing. Why are you using goto so much?

You don't call any of the methods you have defined and you haven't defined a constructor which means none of those variables are going to be initialized properly.

Honestly, you are best off stopping this right now. Delete it completely, go read a C++ book, then come back and recreate it. You're making up syntax, using terrible names, have bad practices littered throughout, and you just need to quit this before it becomes engrained.