Re snek game tutorial 14b.
Posted: August 24th, 2019, 7:30 pm
Ooookay...Love the series so far. This is a big jump, BUT, i managed to write a successful snake game on my own before watching the tutorial..(i watched the first half explaining the planning)...so kudos to me...more importantly kudos to you, coz without your tutorials I'd never have done this. Thanks. Unfortunately my solution used just 2 classes, board and game, I couldn't figure out the location class, but I think I've got it now. So after creating my own version...I followed along with your tutorial and I've so many questions, but I'm trying to figure them out on my own. The ONE problem i've got I don't understand is;
I'm writing the goal class.
void respawn(std::mt19937 & rng, const board& brd, const snake& snake)
{ std::uniform_int_distribution<int> xdist(0,brd.getwidth()-1); //renamed from GetGridWidth
}
I've included "board.h"
but I'm gettting 2 errors.... 1. E1086 the object has type qualifiers that are not compatible with the member function "board::getwidth"
2. C2662 'int board::getwidth(void)': cannot convert 'this' pointer from 'const board' to 'board &'
Can anyone help...Im sure its a typo somewhere, but can't see it for the life of me...My 50yr old brain dont work like the kidses.
I'm writing the goal class.
void respawn(std::mt19937 & rng, const board& brd, const snake& snake)
{ std::uniform_int_distribution<int> xdist(0,brd.getwidth()-1); //renamed from GetGridWidth
}
I've included "board.h"
but I'm gettting 2 errors.... 1. E1086 the object has type qualifiers that are not compatible with the member function "board::getwidth"
2. C2662 'int board::getwidth(void)': cannot convert 'this' pointer from 'const board' to 'board &'
Can anyone help...Im sure its a typo somewhere, but can't see it for the life of me...My 50yr old brain dont work like the kidses.