Hello guys
I'm trying to make a course analysis skill.
To count how many monsters were found between the player and the cell clicked.
The player clicks somewhere on the map, and checks (cell by cell) on that route.
If I find any mobs in the cell then it displays on the console for me:
example:
Printf ("% d Mob found", count);
I know that (src-> x,src-> y) are the coordinates of the skill invoker
And (x, y) are the coordinates of the clicked cell.
Now I need to make a for() to go check cell by cell until it reaches the target cell.
But how to do that? I'm having a hard time
Can someone help me?
Or does anyone know a function to do this?
For those who understand the language C, it should be super easy to do that.
I think logic is something like this:
case TEST:
int mob,x,y;
int dir = map->calc_dir(src,x,y); //Calculate direction
for () { //Looping for traversing cells by cell
x += dirx[dir];
y += diry[dir];
if(){ //If you have a Mob in the cell
printf(" %d Mob found, mob"); //mensage in console
mob++;
}
}
break;
Someone can help me, please, I do not know who to ask for help.
Question
Tio Akima
Hello guys
I'm trying to make a course analysis skill.
To count how many monsters were found between the player and the cell clicked.
The player clicks somewhere on the map, and checks (cell by cell) on that route.
If I find any mobs in the cell then it displays on the console for me:
example:
Printf ("% d Mob found", count);
I know that (src-> x,src-> y) are the coordinates of the skill invoker
And (x, y) are the coordinates of the clicked cell.
Now I need to make a for() to go check cell by cell until it reaches the target cell.
But how to do that? I'm having a hard time
Can someone help me?
Or does anyone know a function to do this?
For those who understand the language C, it should be super easy to do that.
I think logic is something like this:
case TEST: int mob,x,y; int dir = map->calc_dir(src,x,y); //Calculate direction for () { //Looping for traversing cells by cell x += dirx[dir]; y += diry[dir]; if(){ //If you have a Mob in the cell printf(" %d Mob found, mob"); //mensage in console mob++; } } break;
Someone can help me, please, I do not know who to ask for help.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.