Game Project 3-a: Interaction with the game character
So basically it seems like we are finally adding in movement ability for our character with a given ability to draw the character at a new location and then update the location based on which keys are being held down and what not
So you just detect when the right or left arrow is being pressed, use the if statements to control the movement, very very standard stuff, maybe even add in things like booleans for what to do and what not I suppose
I do not know if they want you to do things like simulate gravity yet or not, I assume that we will be needing to do so very soon but who knows really, maybe they will introduce the idea of the axis aligned bounding boxes as a means of seeing if your able to collide with different items. Either way though that would mean you need some sort of an object array which I think is some bullshit for them anyways
It seems this first part is just getting your character to be drawn and then allowing for them to be able to move left or right based on the key presses. Oh shit you actually are going to be able to make them jump as it seems as well.
Game Project 3-b: Canyons and Coins
So you basically have your character be able to have these collectible items and then allow them to interact with the environment around them, letting them collect the items whenever they walk into them.
You use the same file that you used for the part A of the game project, and you paste in the object for the collectible, so basically like the pseudo class instance that you got going on basically. You then obviously need to draw it so you can copy and paste that from the previous project as well.
So you need to have an isFound property to the given object and then you can set it to false, and then do the math for whenever the two given values interact, so you set an if statement to see if the item is found then you do not draw it, so you just change all of that so you can basically have the most basic ass way of collecting an item.
The best way to do this is actually fuck doing the trigonometry yourself, instead they want you to use the dist function because of course they have a built in function that does it for you. You see if the dist function’s value is less than the value from your bounding boxes and is do then you know that you have ended up hitting on your item.