Friday, January 12, 2024

Pygame 16

 Pygame Thursday gave us no16, a very useful runthrough on coding crucial

game elements. Our player now starts safely outside the box where the enemy 

is moving around at random velocities. Interestingly, it doesn't matter if two

of them initiate side by side because there is a wide range of random movement

and they are quicly out of synch.


No real game yet, because all our player has to do is move in and collide with them;

but this will change...

                                                         


I especially appreciated how to keep the enemies in the box. One creates a change

in position variable for both x and y, easier to work with.

                                                                             


                                                                                


We now have a larger game space:

                                                              

Initiating the player:

                                                       

Initiating the enemy:

                                                                   


All the math works out as desired. It is suggested as a homework assignment, 

that one might think about the code that would stop the player from leaving the screen...

                                                             *     *     *

Keeping Score:




From Bing/Chat:

                                                                      
                                     

                                                                  *     *     *

Finally managed to rig the character from the Synfig tutorials. Tomorrow, will

be trying for a walk cycle.

                                                                        






No comments: