on-internet
← Community

Making pong game, how do I accelerate the ball in Swift? [duplicate]

Stack Overflow ·

I am a grad student in an app development course. For my final project, I'm making a pong app. We are allowed to use the textbook and forums for debugging and advice, but we are not allowed to use AI, and I can't look up information we haven't learned. I'm not using SpriteKit, and the textbook is outdated and doesn't cover this. I'm sure this sounds ridiculous, but how do I make the ball move? Here's my code thus far, please note that I am a first year student: import SwiftUI struct ContentView: View { @State private var score1 = 0 @State private var score2 = 0 @State private var ball = CGPoin

Comments

Sign in or sign up to comment and upvote.

No comments yet.