Question
python 3 grid game using Zelle's graphics.py NOT turtle or pygame or any other program I have a window 400x400 which I have split up
python 3 grid game using Zelle's graphics.py NOT turtle or pygame or any other program
I have a window 400x400 which I have split up into a 10x10 'grid' using lines so each square is 40x40 pixels
inside the top left grid I have a 'player piece' which is a 36x36 square
I need to know how to move the 'player' from the top left corner to the bottom right corner using mouse clicks and the rules are:
1. If I click ANYWHERE in the same row as the 'player piece' it moves in that direction by 1 to the right or left depending on the location of the 'player'
2. if I click anywhere in the same column as the piece is moves 1 unit either up or down
3. If I click the actual player piece or NOT in a row or column the piece is in the piece does not move at all
I need it to be as simple as possible. We are just now starting graphics. The key concepts are moving objects and using booleans and conditional statements to determine if the piece should even be allowed to move. Thanks!!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started