![]() To do that, let’s pass the bullets array of the other jet into the update function. So we need to check all of the white bullets against the black jet and all the black bullets against the white jet. It’s no game without a scoring system, so let’s add one! Hitting an enemyĮach frame, we need to loop through all of the bullets and check against their target jet if they have hit them. ![]() Oh yeah, don’t forget to call update on the jets in sketch.js. ![]() I’ve added some comments to highlight what’s been added. Let’s make the jets go forwards, like this. WhiteJetImage = loadImage("white-jet.png") īlackJetImage = loadImage("black-jet.png") Let’s load the images in p5.js preload function, as this executes before setup and draw. Let’s spawn the jets in a random location on the map, by creating a Jet class. Go ahead and copy these for your implementation! Black Jet White jet (Good luck finding it) Drawing the jets I’ve created both the black and white jets in photoshop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |