![]() ![]() #! /usr/bin/env python from game_calc import * from Queue import * import random def game ( screen, clock ): # START EDIT allnodes = for x in xrange ( 32, 982, 10 ): for y in xrange ( 64, 684, 10 ): allnodes. I don’t think this lag will be very good for Spelunky, but I think there’ll be a smaller search space per moment in that game and hopefully C++ will make it run faster (idk, we’ll see). It was quite a bit of work, but it turned out pretty well didn’t it? :) There’s a bit of lag I guess because it has to calculate the path with such a large grid. ![]() Everything else was written and belongs to Rosenqvist.īasically, I had to set up the algorithm, run it after 5 frames at the start and whenever the snake eats a piece of food, make the snake change direction based on the path calculated and draw the path on the screen. The only file that I modified was game.py and the edits are between the “BEGIN EDIT” and “END EDIT”. ![]() #HOW TO EDIT SNAKE IN SCREEN SNAKE CODE#Here is a video demonstrating the agent that I made:īitsnake’s code took a little while to understand but I decided to write over it. A* is pretty simple to understand, it basically chooses a path by taking into consideration the distance from the start and the estimated distance from the goal. Using this resource and bitSnake (by Fredrik Rosenqvist), I decided to create an agent that plays the game using A. To get started with A, I decided to do something simple. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |