report an error.
import sys
import pygame
from settings import Settings
from ship import Ship
def run_game ():
-sharp
pygame.init()
ai_settings=Settings()
screen=pygame.display.set_mode(
(ai_settings.screen_width,ai_settings,screen_height))
pygame.display.set_caption("Alien Invasion")
-sharp
ship=Ship(screen)
-sharp
while True:
-sharp
screen.fill(ai_settings.bg_color)
ship_blitme()
-sharp
pygame.display.flip()
run_game ()
class Settings ():
"""{}"""
def__init__(self):
""""""
-sharp
self.screen_width=1200
self.screen_height=800
self.bg_color=(230,230,230)
import pygame
class Ship ():
def__init__(self,screen):
""""""
self.screen= screen
-sharp
self.image=pygame.image.load("images/ship.bmp")
self.rect=self.image.get_rect()
self.screen_rect=screen.get_rect()
-sharp
self.rect.centerx=self.screen_rect.centerx
slef.rect.bottom=self.screen_rect.bottom
def blitme (self):
""""""
self.screen.blit(self.image,self.rect)
error code
Python 3.7.1 (v3.7.1 bit 260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
= RESTART: D:alien_invasionalien_invasion.py =
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contri.
Traceback (most recent call last):
File" D:alien_invasionalien_invasion.py ", line 5, in < module >
from settings import Settings
File "D:alien_invasionsettings.py", line 3
def__init__(self):
^
SyntaxError: invalid syntax
beginners have been thinking about it for a long time. No, no, no.