문제

I'm trying to make a small IA32 game(AT&T), the problem I'm facing at the moment is I don't know how/where to store the snakes body and the "apples" to be able to check for collisions. The snakes size is constantly increasing so the container should be dynamically allocated?

In a high level language I'd use a 2d vector/array/linked list or similar to store the coordinates and then compare after a move is made.

any suggestions are welcome.

(Looked at similar questions but didn't get my question answered)

도움이 되었습니까?

해결책

The snake can't be longer than the field, so allocate the suitable amount of memory statically or dynamically - it is up to you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top