- map->offset.y--;
- }
- else if (WEST == d && map->offset.x > 0)
- {
- map->offset.x--;
- }
- else if (SOUTH == d && map->offset.y + win_size.y < map->size.y)
- {
- map->offset.y++;
+ offset = center_offset(win->center.y,
+ world.map->size.y, win->framesize.y);
+ win->center.y = offset + (win->framesize.y / 2);
+ if ('N' == d && win->center.y > 0)
+ {
+ win->center.y--;
+ }
+ else if ('S' == d && win->center.y < world.map->size.y - 1)
+ {
+ win->center.y++;
+ }