예제 #1
0
    def __init__(self):
        #RESOLTUIONS ISSUES
        self.RESOLUTIONS = [(1366, 768), (683, 768 / 2), (1024, 768),
                            (800, 600)]
        self.FULL_SCREEN = False

        self.WIDTH = pg.display.Info().current_w
        self.HEIGHT = pg.display.Info().current_h

        self.resolution = 3
        for i in range(0, 4):
            if (self.RESOLUTIONS[i][0] == self.WIDTH
                    and self.RESOLUTIONS[i][1] == self.HEIGHT):
                self.resolution = i

        if (self.FULL_SCREEN == False):
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution])
        else:
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution], pg.FULLSCREEN)

        #TAKE OFF IF RELEASE
        self.change_resolution(0)

        #GAME STATES
        self.current_state_index = 0
        self.current_state = Splash_Screen(self.display,
                                           self.RESOLUTIONS[self.resolution])
예제 #2
0
	def set_state(self,next_state):
		if(next_state == 1):
			self.current_state_index = next_state;
			self.current_state = Test_State(self.display,self.RESOLUTIONS[self.resolution]);
		if(next_state == 0):
			self.current_state_index = next_state;
			self.current_state = Splash_Screen(self.display,self.RESOLUTIONS[self.resolution]);
예제 #3
0
class Manager:
    def __init__(self):
        #RESOLTUIONS ISSUES
        self.RESOLUTIONS = [(1366, 768), (683, 768 / 2), (1024, 768),
                            (800, 600)]
        self.FULL_SCREEN = False

        self.WIDTH = pg.display.Info().current_w
        self.HEIGHT = pg.display.Info().current_h

        self.resolution = 3
        for i in range(0, 4):
            if (self.RESOLUTIONS[i][0] == self.WIDTH
                    and self.RESOLUTIONS[i][1] == self.HEIGHT):
                self.resolution = i

        if (self.FULL_SCREEN == False):
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution])
        else:
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution], pg.FULLSCREEN)

        #TAKE OFF IF RELEASE
        self.change_resolution(0)

        #GAME STATES
        self.current_state_index = 0
        self.current_state = Splash_Screen(self.display,
                                           self.RESOLUTIONS[self.resolution])

    def update(self, delta):
        key = pg.key.get_pressed()
        self.current_state.update(delta, key)

        if (self.current_state.next_state):
            self.set_state(self.current_state_index + 1)

    def draw(self):
        self.current_state.draw(self.display)

    def set_state(self, next_state):
        if (next_state == 1):
            self.current_state_index = next_state
            self.current_state = Test_State(self.display,
                                            self.RESOLUTIONS[self.resolution])
        if (next_state == 0):
            self.current_state_index = next_state
            self.current_state = Splash_Screen(
                self.display, self.RESOLUTIONS[self.resolution])

    def change_resolution(self, res):
        self.resolution = res
        if (self.FULL_SCREEN == False):
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution])
        else:
            self.display = pg.display.set_mode(
                self.RESOLUTIONS[self.resolution], pg.FULLSCREEN)
예제 #4
0
 def set_state(self, next_state):
     if (next_state == 1):
         self.current_state_index = next_state
         self.current_state = Test_State(self.display,
                                         self.RESOLUTIONS[self.resolution])
     if (next_state == 0):
         self.current_state_index = next_state
         self.current_state = Splash_Screen(
             self.display, self.RESOLUTIONS[self.resolution])
예제 #5
0
class Manager:
	def __init__(self):
		#RESOLTUIONS ISSUES
		self.RESOLUTIONS = [(1366,768),(683,768/2),(1024,768),(800,600)];
		self.FULL_SCREEN = False;

		self.WIDTH = pg.display.Info().current_w;
		self.HEIGHT = pg.display.Info().current_h;

		self.resolution = 3;
		for i in range(0,4):
			if(self.RESOLUTIONS[i][0] == self.WIDTH and self.RESOLUTIONS[i][1] == self.HEIGHT):
				self.resolution = i;

		if(self.FULL_SCREEN == False):
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution]);
		else:
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution],pg.FULLSCREEN);


		#TAKE OFF IF RELEASE
		self.change_resolution(0);

		#GAME STATES
		self.current_state_index = 0;
		self.current_state = Splash_Screen(self.display,self.RESOLUTIONS[self.resolution]);
		

	def update(self,delta):
		key = pg.key.get_pressed();
		self.current_state.update(delta,key);

		if(self.current_state.next_state):
			self.set_state(self.current_state_index+1);	


	def draw(self):
		self.current_state.draw(self.display);



	def set_state(self,next_state):
		if(next_state == 1):
			self.current_state_index = next_state;
			self.current_state = Test_State(self.display,self.RESOLUTIONS[self.resolution]);
		if(next_state == 0):
			self.current_state_index = next_state;
			self.current_state = Splash_Screen(self.display,self.RESOLUTIONS[self.resolution]);

	def change_resolution(self,res):
		self.resolution = res;	
		if(self.FULL_SCREEN == False):
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution]);
		else:
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution],pg.FULLSCREEN);
예제 #6
0
	def __init__(self):
		#RESOLTUIONS ISSUES
		self.RESOLUTIONS = [(1366,768),(683,768/2),(1024,768),(800,600)];
		self.FULL_SCREEN = False;

		self.WIDTH = pg.display.Info().current_w;
		self.HEIGHT = pg.display.Info().current_h;

		self.resolution = 3;
		for i in range(0,4):
			if(self.RESOLUTIONS[i][0] == self.WIDTH and self.RESOLUTIONS[i][1] == self.HEIGHT):
				self.resolution = i;

		if(self.FULL_SCREEN == False):
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution]);
		else:
			self.display = pg.display.set_mode(self.RESOLUTIONS[self.resolution],pg.FULLSCREEN);


		#TAKE OFF IF RELEASE
		self.change_resolution(0);

		#GAME STATES
		self.current_state_index = 0;
		self.current_state = Splash_Screen(self.display,self.RESOLUTIONS[self.resolution]);