Skip to content
Snippets Groups Projects
Commit cd91727a authored by 's avatar
Browse files

help page

parent 132039ff
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 1 deletion
......@@ -9,7 +9,7 @@ import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y)
import pygame, sys
import highscore, theme
import help_, highscore, theme
## @brief A Class that will contain useful functions in order for the creation of main interface
class GUI():
......@@ -90,6 +90,11 @@ def main():
GUI.button(game,lightBlue, [400,450,180,50], 0)
GUI.custom_text('Advanced',"Roboto-Light.ttf", 25,[239, 245, 224],(435,457),game)
if (365 <= mousepos[0] <= 365+55 and 565 <= mousepos[1] <= 565+35 ):
if mouseclick[0] == 1:
help_.main()
GUI.text('Help',"comicsansms", 25,[0,0,0],(365,565),game)
if (15 <= mousepos[0] <= 15+115 and 565 <= mousepos[1] <= 565+35 ):
if mouseclick[0] == 1:
highscore.main()
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
File added
File added
No preview for this file type
No preview for this file type
No preview for this file type
## @file help.py
# @author Vaibhav Chadha
# @brief implements the help interface of this game
# @date 11/09/2018
#importing necessary libraries
x = 10
y = 40
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y)
import pygame, sys
import Interface
def main():
pygame.init()
image1 = pygame.image.load("Exit_image.png")
run = True
while run:
help_ = pygame.display.set_mode((500,500))
help_.blit(image1,(0,0))
mousepos = pygame.mouse.get_pos() #checking mouse position
mouseclick = pygame.mouse.get_pressed()#checking mouse pressed
pygame.display.set_caption("Help")
Interface.GUI.text('Use the following keys for the movement of the snake:','times',20,[130,190,0],(40,30),help_)
Interface.GUI.text('"Up" arrow key for turning Upwards','times',20,[90,190,0],(60,60),help_)
Interface.GUI.text('"Down" arrow key for turning Downwards','times',20,[90,190,0],(60,90),help_)
Interface.GUI.text('"Right" arrow key for turning Rightwards','times',20,[90,190,0],(60,120),help_)
Interface.GUI.text('"Left" arrow key for turning Leftwards','times',20,[90,190,0],(60,150),help_)
Interface.GUI.text('Beginner:','times',20,[200,0,0],(60,190),help_)
Interface.GUI.text('The snake can cross through the boundaries','times',20,[90,190,0],(140,190),help_)
Interface.GUI.text('Intermediate:','times',20,[200,0,0],(60,220),help_)
Interface.GUI.text('The snake will die as it touches the ','times',20,[90,190,0],(165,220),help_)
Interface.GUI.text('boundary.(The speed is faster than beginner)','times',20,[90,190,0],(140,250),help_)
Interface.GUI.text('Advance:','times',20,[200,0,0],(60,280),help_)
Interface.GUI.text('The snake will die as it touches the boundary','times',20,[90,190,0],(140,280),help_)
Interface.GUI.text('or barrier.(Same speed as intermediate)','times',20,[90,190,0],(120,310),help_)
Interface.GUI.text('THEMES','times',20,[0,50,200],(110,340),help_)
Interface.GUI.text('Regular Dark','times',20,[200,0,0],(220,340),help_)
Interface.GUI.text('Snake','times',20,[200,0,0],(100,370),help_)
Interface.GUI.text('Background','times',20,[200,0,0],(80,400),help_)
Interface.GUI.text('BLUE WHITE','times',20,[90,190,0],(220,370),help_)
Interface.GUI.text('WHITE BLACK','times',20,[90,190,0],(220,400),help_)
if (160 <= mousepos[0] <= 160+180 and 440 <= mousepos[1] <= 440+50 ):
#checks if the mouse is hovering over the button
Interface.GUI.button(help_,[100,100,100], [160,440,180,50], 0)
#checking if the button is clicked
if mouseclick[0] == 1:
Interface.main()
else:
Interface.GUI.button(help_,[180,180,180], [160,440,180,50], 0)
Interface.GUI.custom_text('Main Menu',"Roboto-Light.ttf", 30,[0, 0, 0],(172,447),help_)
pygame.display.update()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment