Screen snake no borders3/30/2024 Self.food_1.food_rect.topleft = (self.food_1.x, self.food_1. Self.food_1.y = random.randint(0, 29) * cellSize Self.food_1.x = random.randint(0, 29) * cellSize Self.food_rect = pygame.Rect(self.x, self.y, self.width, self.height) Snake_rect = pygame.Rect(cor, cor, self.width, self.height) (screen, white, (0, y), (screen_width, y)) The snake continually grows and the longer you play the more difficult it is not to collide with the snake Features: Designed for Windows Phone Three different control modes: Four directional buttons Two buttons: left/right Swipe gestures Highscore list lets you see the trail of the snake Sounds and vibration feedback No collision with borders Three different speed levels New in this version: Snake has tongue Fix for high-resolution Windows Phone 8 devices. (screen, white, (x, 0), (x, screen_height))įor y in range(0, screen_width, cellSize): Screen = _mode((screen_width, screen_height))įor x in range(0, screen_height, cellSize): Afterwards, the snake is able to simply move off the screen. However, when I run the program the collision detection only works once. In the main class in the collision method, I wrote some code to detect the snake collision with the borders of the screen, and if the statement is true, the snake will return to its original state. I'm making a snake game in python, and I've almost finished, but I'm struggling to solve an issue.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |