firetto / Physics11Simulation

The thing for Mr. Salavati
2 stars 0 forks source link

Regarding Cannon and Map Objects #1

Open FlatPaper opened 5 years ago

FlatPaper commented 5 years ago

In order to differentiate objects of the map and cannons, we should give it a tag and change the colour of it.

https://github.com/firetto/Physics11Simulation/blob/5e4070072daf523a04277d9fa0ab3c94772a258e/cannon.js#L36

FlatPaper commented 5 years ago

A good approach to fixing this issue is to add a field to the constructor from object.js:

https://github.com/firetto/Physics11Simulation/blob/5e4070072daf523a04277d9fa0ab3c94772a258e/object.js#L5

FlatPaper commented 5 years ago

Ok, another thing, instead of projectileType which is :bleh:, this should be named projectileShape, while projectileType addresses whether an object is a map object or a cannon object.

https://github.com/firetto/Physics11Simulation/blob/121d86b0ff6b001bc6d5eef31f33fa732a5b9e68/object.js#L12

firetto commented 5 years ago

Yes, you can fix it, seems like a good idea 👍 For now, go to the draw function of the object and change the beginFill parameter (it's a hex code) for the map objects to be a different color than the cannon projectile.