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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!