How to make ball move in Swift?
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. I'm not using SpriteKit. I'm sure this sounds ridiculous to most but how do I make the ball move? Here's my code thus far: import SwiftUI struct ContentView: View { @State private var score1 = 0 @State private var score2 = 0 @State private var ball = CGPoint(x: 0, y: 0) @State private var handles1 = CGFloat(300) @State private var handles2 = CGFloat(300) @State private var gameover = false var win
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.