Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Game::Init()
- {
- if (SDL_Init(SDL_INIT_VIDEO) < 0)
- {//If video fails, send failure signal.
- return -1;
- }
- win = SDL_CreateWindow ("Space Warriors",
- /*Make windows for game
- * 800x600 screen
- * Position = center
- */ SDL_WINDOWPOS_UNDEFINED,
- SDL_WINDOWPOS_UNDEFINED,
- 800,600,
- SDL_WINDOW_SHOWN);
- if (win == NULL)
- {
- return -1;
- }
- screen = SDL_GetWindowSurface(win);
- SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 255, 255, 255) );
- if (playerShip.Init() == -1)
- {
- return -1;
- }
- Asteroid t;
- asteroids.push_back(t);
- if(asteroids[0].Init() == -1)
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement