Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findpath failed #1

Open
unrealyx opened this issue Jul 12, 2024 · 2 comments
Open

findpath failed #1

unrealyx opened this issue Jul 12, 2024 · 2 comments

Comments

@unrealyx
Copy link

unrealyx commented Jul 12, 2024

No description provided.

@unrealyx
Copy link
Author

Int32 GridWidth = 112, GridHeight = 112;
spCollision->Create(GridWidth, GridHeight);
Int32 Sx = 52, Sy = 43;
Int32 Ex = 61, Ey = 65;

//Int32 Ex = 52, Ey = 43;
//Int32 Sx = 61, Sy = 65;

std::ifstream file("collition.txt");
if (!file.is_open()) {
	std::cerr << "Failed to open file" << std::endl;
	return 1;
}
std::string line;
while (std::getline(file, line)) {
	std::stringstream ss(line);
	std::string token;

	while (std::getline(ss, token, ',')) {
		int index = std::stoi(token);
		int x = index % GridWidth;
		int y = index / GridWidth;
		spCollision->SetAt(x, y);
	}
}

collition.txt

@unrealyx
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant