top of page
Search

9/18 - 9/22

  • Writer: Nathan Matarazzo
    Nathan Matarazzo
  • Sep 21, 2023
  • 2 min read

This week I continued work on my arcade machine project. I was messing around trying to find a way to add force to the basketball for the jump-shot function in the game, and while it sounded like an easy task at first, I couldn't, for the life of me, figure it out. I watched several tutorials on adding a force to an object in unity, but none of them had to deal with a script on another component controlling the force added to a separate component. I eventually figured it out by using the (variable) = GameObject.Find("Basketball").GetComponent<Rigidbody2D>(); function to find the component within the game's assets and use (variable).AddForce(new Vector2(x, y), ForceMode2D.Impulse); to actually add force to it.

ree

ree

Now I need to figure out how to find the player's distance from the rim, and use that to change the x-axis power that is added to the ball. I will then combine that variable with an rng (random number generator) to add an element of risk when one shoots the ball, and I will also change the maximum and minimum of the rng depending on which character in the game is being used, so that different players will have higher and lower probabilities of getting the ball in the rim. I will also balance this out by having certain characters be faster, taller, or be able to jump higher in order to give each character a sense of individuality and uniqueness.


Next, I designed what the interior of my arcade machine will look like. It will have a pcb connected to each button. It will be connected to a pcb with a raspberry pico which will supply power to both pcbs and as well as being able to read the buttons on the first pcb. I will import a code to the pico to make each button correspond to a key on a keyboard, which is why, in my code, I use the keycode function a lot, since that is what is going to be used to actually play the game. The two pcbs will be connected with standoffs, and the pico will have a usb that will connect it to a raspberry pi, which is what will actually run the game. The raspberry pi will have an hdmi connected to the monitor, and be able to supply power and ground to the whole system, since it will be connected to a power outlet on the wall. The picture below is a rough design of what that will look like. I am also considering using a crude switch to turn power on and off from certain parts of the system.

ree

 
 
 

Comments


© 2035 by TheHours. Secured by NM inc.

bottom of page