{"id":15894591,"url":"https://github.com/rusty1s/rsscene","last_synced_at":"2025-09-21T00:45:44.603Z","repository":{"id":35577033,"uuid":"39849338","full_name":"rusty1s/RSScene","owner":"rusty1s","description":"An inheritance of SKScene that adds a game logic loop to the runtime of a scene (Swift)","archived":false,"fork":false,"pushed_at":"2015-07-30T22:02:31.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T18:24:28.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rusty1s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T17:54:54.000Z","updated_at":"2022-02-10T17:51:03.000Z","dependencies_parsed_at":"2022-09-06T23:40:29.112Z","dependency_job_id":null,"html_url":"https://github.com/rusty1s/RSScene","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rusty1s/RSScene","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2FRSScene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2FRSScene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2FRSScene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2FRSScene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rusty1s","download_url":"https://codeload.github.com/rusty1s/RSScene/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2FRSScene/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276179882,"owners_count":25598571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T08:40:38.831Z","updated_at":"2025-09-21T00:45:44.581Z","avatar_url":"https://github.com/rusty1s.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSScene\n\n`RSScene` inherits `SKScene` by adding a game logic loop to the runtime of a scene implemented in **Swift**. `RSScene` distinguishs between a rendering loop (fps) and a loop, that calls game update logic. The logic loop typically runs much slower than the rendering loop, because games don't need to update its logic that often. This guarantees great performance for all kind of games!\n\n## Usage\n\n1. Let your scene implementation inherits `RSScene` instead of `SKScene`.\n2. Set the logic loop rate, called `tps` (ticks per seconds), e.g. `self.tps = 10`.\n3. You can display the current tps of your scene by writing `self.showsTPS = true`, suitable for debugging.\n4. Update your game logic in `updateGameLogic(currentTime: NSTimeInterval)`.\n\n**Info:** When overriding your scene methods `didMoveToView`, `willMoveFromView` or `update`, you need to call its super methods first!\n\n## Installation\n\n`RSScene` is not yet released on CocoaPod. Instead use\n\n```\nuse_frameworks!\n\npod 'RSScene', :git =\u003e 'https://github.com/rusty1s/RSScene.git'\n```\n\nin your Podfile and run `pod install`.\n\n## Documentation\n\n### RSScene\n\n\tclass RSScene { ... }\n\n#### Inheritance\n\n* `SKScene`\n\n#### Instance variables\n\n\tvar tps: Int { get set }\n\nThe amount of times the game logic is called per second. The default value is 30 ticks per seconds.\n\n\tvar showsTPS: Bool { get set }\n\nA Boolean value that indicates whether the scene's view displays a game logic rate indicator.\n\n\tvar priority: qos_class_t { get set }\n\nThe quality of service you want to give to the logic loop executed in the global queue. The default value is `QOS_CLASS_BACKGROUND`.\n\n\tvar logicDelegate: RSSceneDelegate? { get set }\n\nA delegate to be called during the logic loop. When the delegate is present, your delegate is called instead of the corresponding method on the scene object.\n\n#### Executing the Game Logic Loop\n   \n    public func updateGameLogic(currentTime: NSTimeInterval)\n\nPerforms any game-logic-specific updates.\n\n### RSSceneDelegate\n\nThe `RSSceneDelegate` protocol is used to implement a delegate to be called whenever the logic of the scene is being calculated. Typically, you supply a delegate when you want to use a scene without requiring the scene to be subclassed. The method in this protocol correspond to the method implemented by the `RSScene` class. If the delegate is present, the method is called instead of the corresponding method on the scene object.\n\n\tprotocol RSSceneDelegate { ... }\n\n#### Instance methods\n\n    func updateGameLogic(currentTime: NSTimeInterval, forScene scene: RSScene)\n\nPerforms any game-logic-specific updates.\n\n## Additional information\n\n`RSScene` was developed and implemented for the use in *Dig Deeper - the Mining / Crafting / Trading game*. *Dig Depper* is currently in developement and has its own *GitHub* project [here](../../../DigDeeper).\n\n![alt Dig Deeper](../../../DigDeeper/blob/master/logo.png)\n\n## License\n\nCopyright (c) 2015 Matthias Fey \u003cmatthias.fey@tu-dortmund.de\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty1s%2Frsscene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusty1s%2Frsscene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty1s%2Frsscene/lists"}