Using SwiftUI's Built In Charts Feature in Swift Playgrounds!

Опубликовано: 30 Январь 2023
на канале: JohnDav
1,716
33

This is the second part of a multi-part Swift Playgrounds build series where I build a game using SpriteKit on my iPad with Swift Playgrounds.

If you missed part 1 you can start here:    • Building a Game on an iPad with Swift...  

This week's video lays the groundwork for the first core gameplay mechanic of the game. Resource management. The player will be tasked with navigating the world to earn their high score, but no rocket should have infinite fuel. So the player will need to locate and find fuel cells through the game world that replenish the supply.

The mechanics behind this interaction are entirely physics-based. The rocket will collide with the fuel supply and fuel will be added to the rocket's tank according to the type of fuel found.

There are three types of fuel in the game and they each have their own function. Blue fuel will allow you to move forward, while red and orange fuel is used for rotating the rocket.

In the next video I'll be working on a few bug fixes (can you spot them in this video?) and I'll be adding my first attack to the game so get subscribed if you aren't already so that you don't miss it.

0:00 - Storing game data and passing it between SwiftUI & SpriteKit
3:04 - Writing to game data in the SpriteKit scene
4:05 - Reading game data in the SwiftUI view
5:09 - Displaying the data using Charts in SwiftUI
10:16 - Creating the Fuel Supply for Refueling the Rocket
22:26 - Setting up contact detection with didBegin(_ contact:)

#swiftplaygrounds #swiftui #gamedev #indiedev

//Things I've Made
ZER0ED: https://apps.apple.com/us/app/zer0ed/...
Shapes&Numbers: https://apps.apple.com/us/app/shapes-...
My Website: https://www.johndav.com


Смотрите видео Using SwiftUI's Built In Charts Feature in Swift Playgrounds! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь JohnDav 30 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,716 раз и оно понравилось 33 людям.