Will-Griffiths-Ireland / Star-Wars-Rebel-Alliance-Negotiation-Simulator

Team 5 Hackathon entry for Code Institute - May 2023
2 stars 4 forks source link

US - Background Addition Tweak #22

Closed CallumDennisIE closed 1 year ago

CallumDennisIE commented 1 year ago

Tweak Background Code

To make it easier for each team member to create their own levels, we can make the addBackground function accept the filename as a parameter.

This would mean that we can separate the GameEngine code and the level creation code.

Example

Before

Screenshot 2023-05-12 at 22 15 36

Old creation code:

Screenshot 2023-05-12 at 22 16 19

After

Screenshot 2023-05-12 at 21 51 12

New creation code:

Screenshot 2023-05-12 at 21 59 39
CallumDennisIE commented 1 year ago

Tweak Target and Prop

This could also be used in the addProp and addTarget code. This could replace the switch statement and instead make the type parameter the same as the image name.

This is less of a priority because it doesn't improve any functionality, but could make the code a bit more condensed and easier to read with less work

Example:

Before:

Screenshot 2023-05-12 at 22 11 11

After:

Screenshot 2023-05-12 at 22 10 50