Post

Replies

Boosts

Views

Activity

Reply to How to build SpriteKit game using SwiftUI?
I am using SwiftUi and Spritekit for my level editor (the game don't use SwiftUi) That's an example like my project (I removed most of the content because my scene has many code) I hope it will help you You create you Spritkit Scene file import Foundation import SpriteKit import SwiftUI class SceneTileMap: SKScene {     var tileMap : SKTileMapNode!     var tileSet : SKTileSet! ... override func didMove(to view: SKView) { ... } override func mouseDown(with event: NSEvent) { ... } } And in the same file you add the code for create the swiftUI view : struct MapView: View {     @EnvironmentObject var paramConstructeur: ParamètresConstructeur     var scene: SceneTileMap {         let scene = SceneTileMap()         scene.size = CGSize(width: 1000, height: 800)         scene.scaleMode = .fill         scene.paramConstructeur = paramConstructeur         return scene     }     func updateparams() {         scene.paramConstructeur = paramConstructeur     }     var body: some View {         SpriteView(scene: scene)             .padding(.all)             .frame(width: 1000, height: 800)             .ignoresSafeArea()     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’21
Reply to Random Map Generation + Interactive Tiles (SKTileMapNode)
I developped an procedural generation map with SKTilemap it's a very good tools for create such maps. You can find example here : https://twitter.com/GenetixVideos/status/1233686731200909312 (sorry the forum has troubles i can't upload new pics) I had performances issues but only with very very big maps, one of my biggest maps was 12800 squares width and 7200 squares height and i had no performances issues at these size (and my code was not optimized) And during map generation i was creating some GKgraph for other steps but they could be used for creating pathways for GKEntities. Mayebe you should create your sktilemap and graph and after create your entities Show us more of your project for more help or send me a message
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21