User Tools

Site Tools


notes:cprog:spring2025:projects:mtb2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:cprog:spring2025:projects:mtb2 [2025/02/25 03:55] – [computer operated player] tstricklnotes:cprog:spring2025:projects:mtb2 [2025/02/25 22:07] (current) – [score display] bdildine
Line 24: Line 24:
 ====score display==== ====score display====
 Within the video.h header file, there is a series of print functions, which prints characters to the screen based on the string that is provided to it. Within the video.h header file, there is a series of print functions, which prints characters to the screen based on the string that is provided to it.
 +You can use the itoa(); function included in the string.h header file to convert your score from and integer to a string if that's the method you are using.
 ====computer operated player==== ====computer operated player====
 To allow for the paddle to track the ball, it would be recommended to find a linear equation to represent the balls path, that which changes everytime it bounces of the roof, floor, or paddle. After finding the y-intercept, x-intercept, and slope of the ball's particular direction, It is now possible for the paddle to predict where the ball will be. This is done by plugging in the paddle's x position into the equation, thus returning the y coordinate output that the ball will be at when on the domain of the paddle. To allow for the paddle to track the ball, it would be recommended to find a linear equation to represent the balls path, that which changes everytime it bounces of the roof, floor, or paddle. After finding the y-intercept, x-intercept, and slope of the ball's particular direction, It is now possible for the paddle to predict where the ball will be. This is done by plugging in the paddle's x position into the equation, thus returning the y coordinate output that the ball will be at when on the domain of the paddle.
notes/cprog/spring2025/projects/mtb2.1740455717.txt.gz · Last modified: 2025/02/25 03:55 by tstrickl