STREGAsGate / Raylib

A Swift package for Raylib. Builds Raylib from source so no need to fiddle with libraries. Just add as a dependency in you game package and go!
MIT License
110 stars 14 forks source link

Can't make sense of the README. #12

Closed 7ombie closed 1 month ago

7ombie commented 1 year ago

I tried to follow the README, but it didn't make sense. Steps 1 and 2 were fine (and I could build the project with the dependency, without any code of my own), but Step 3 was completely confusing:

  1. Add the following to the static func main() in MyGame.swift.

The swift package init --type executable command does not create a file named MyGame.swift. There's only main.swift (inside ~/Projects/MyGame/Sources). And, I cannot add the provided code "to the static func main()", as that construct doesn't exist in Swift. A static func must be a method.

Note: The main.swift file only contains print("hello world") by default. There's no class or struct or anything to add to.

It looks like a really fun project. I just couldn't follow the tutorial. :(

aimawari commented 1 year ago

Swift doesn’t have a main function. instead, it has a main file

You can add code in step 3 directly to main.swift file without create struct func main()