Hello everyone!.. I am writing this post to tell you all, about my progress so far in making "The Checkers", and what I 've been doing so far . So, as in previous post I discussed about my planning in making the game. Now, I have started working for the implementation of the game . You can see the game board below which I made using this code;
import pygletfrom pyglet.window import keyfrom pyglet.window import mousefrom pyglet.window import glclass checkers(pyglet.window.Window): bgimage=pyglet.resource.image('a.png') def __init__(self): super(checkers,self).__init__(600, 600, resizable=False, # Make sure it is not resizable caption="checkers", # Caption of window config=pyglet.gl.Config(double_buffer=True), # Avoids flickers vsync=False # For flicker-free animation ) # Calling base class constructor # Get an instance of current platform platform = pyglet.window.get_platform() # Get an instance of current display display = platform.get_default_display() # Get an instance of current screen screen = display.get_default_screen() # Make sure that game approximately is placed as center of screen # This will adjust for different resolution. Relative positioning # Using resolution to center game window self.set_location(screen.width//2-250,screen.height//2-300) def on_draw(self): ##This is my draw function which is implementing images. self.clear() self.bgimage.blit(0,0)if __name__=="__main__": mygame=checkers() pyglet.app.run()
So this is the work I did initially and in the next post I well tell you about the further implementation of the game and the changes I made in it.Wait for my next blog, it is gonna publish soon...
Comments
Post a Comment