{"id":15026918,"url":"https://github.com/johnsundell/imagineengine","last_synced_at":"2025-04-08T00:37:05.811Z","repository":{"id":46610646,"uuid":"106452675","full_name":"JohnSundell/ImagineEngine","owner":"JohnSundell","description":"A project to create a blazingly fast Swift game engine that is a joy to use 🚀","archived":false,"fork":false,"pushed_at":"2020-09-03T19:52:06.000Z","size":1405,"stargazers_count":1836,"open_issues_count":29,"forks_count":102,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-04-08T00:36:56.503Z","etag":null,"topics":["2d-game-engine","coreanimation","game-development","game-engine","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnSundell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-10T18:00:33.000Z","updated_at":"2025-04-07T00:25:33.000Z","dependencies_parsed_at":"2022-08-21T03:20:42.831Z","dependency_job_id":null,"html_url":"https://github.com/JohnSundell/ImagineEngine","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FImagineEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FImagineEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FImagineEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FImagineEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnSundell","download_url":"https://codeload.github.com/JohnSundell/ImagineEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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","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":["2d-game-engine","coreanimation","game-development","game-engine","swift"],"created_at":"2024-09-24T20:05:23.546Z","updated_at":"2025-04-08T00:37:05.769Z","avatar_url":"https://github.com/JohnSundell.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"Logo.png\" width=\"484\" max-width=\"80%\" alt=\"Imagine Engine\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://dashboard.buddybuild.com/apps/59e21f30b84107000143844a/build/latest?branch=master\"\u003e\n        \u003cimg src=\"https://dashboard.buddybuild.com/api/statusImage?appID=59e21f30b84107000143844a\u0026branch=master\u0026build=latest\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-5.0-orange.svg\" /\u003e\n    \u003ca href=\"https://cocoapods.org/pods/ImagineEngine\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/v/ImagineEngine.svg\" alt=\"CocoaPods\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/johnsundell\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/contact-@johnsundell-blue.svg?style=flat\" alt=\"Twitter: @johnsundell\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nWelcome to **Imagine Engine**, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a joy to use. You are hereby invited to participate in this new community to build a tool with an ambitious but clear goal - to enable you to easily build any game that you can imagine.\n\n## Fast Core Animation-based rendering\n\nImagine Engine uses Core Animation as its rendering backend - just like Apple's UI frameworks like UIKit and AppKit do. By leveraging the power of Core Animation's hardware accelerated 2D rendering capabilities, Imagine Engine is able to push lots of pixels onto the screen at the same time. That means more objects, more effects and less restrictions when designing your games.\n\n## An easy to use API\n\nBesides its goal of being blazingly fast at rendering \u0026 updating your games, Imagine Engine aims to provide an easy to use API that anyone can learn - regardless of game development experience.\n\nStart with just a few lines of code...\n\n```swift\nlet scene = Scene(size: UIScreen.main.bounds.size)\n\nlet label = Label(text: \"Hello world\")\nlabel.position = scene.center\nscene.add(label)\n\nlet window = GameWindow(scene: scene)\nwindow.makeKeyAndVisible()\n```\n\n...and smoothly scale up as your game grows in complexity on either iOS, macOS or tvOS.\n\n🌃 **Scenes present your game content**\n\nA scene can be a level, a menu or a \"Game over\" screen. You can easily switch the active scene of a game. Here's how you can create a scene with a blue background color:\n\n```swift\nlet scene = Scene(size: Size(width: 500, height: 300))\nscene.backgroundColor = .blue\ngame.scene = scene\n```\n\n🎭 **Actors bring your game to life**\n\nActors are what will make up most of the active objects in any game. They are movable, animatable, can handle collisions and much more. Here's an example of how you can create a player that renders a \"Running\" animation, and constantly moves to the right:\n\n```swift\nlet player = Actor()\nplayer.animation = Animation(name: \"Running\", frameCount: 5, frameDuration: 0.15)\nplayer.velocity.dx = 50\nscene.add(player)\n```\n\n📦 **Easily create platforms and tiled textures with Blocks**\n\nUsing blocks you can easily tile textures together to form objects that can scale nicely to any size, without having to scale any texture. This is done by stitching together up to 9 different textures to form a block of textures rendered side by side. Here's how you can easily create a block from a folder named \"Platform\" that contains the textures that should be stitched together:\n\n```swift\nlet block = Block(size: Size(width: 300, height: 300), textureCollectionName: \"Platform\")\nscene.add(block)\n```\n\n🅰️ **Render text using Labels**\n\nLabels let you add text content to your game. They automatically resize to fit your text content (unless you don't want them to) and can be used to implement things like UI, score counters, etc. Here's an example of adding a label to a scene:\n\n```swift\nlet label = Label(text: \"Welcome to my game!\")\nlabel.position = scene.center\nscene.add(label)\n```\n\n⚡️ **Use Events to drive your game logic**\n\nEvents enable you to quickly script your games to drive your own logic. Imagine Engine's various objects contain built in events that can be used to observe whenever an object was moved, collided with something, etc. You can also define your own events that can be used to communicate between various parts of your code. Here's how you can observe whenever two actors collided with each other:\n\n```swift\nlet player = Actor()\nlet enemy = Actor()\n\nplayer.events.collided(with: enemy).observe {\n    // Game over\n}\n```\n\n🏃 **Create animations and effects using Actions**\n\nActions let you make objects do something over a period of time, for example moving, resizing, fading in and out etc. Imagine Engine contains a suite of built-in actions and also makes it easy for you to define your own. Here's how an actor can be moved over 3 seconds:\n\n```swift\nlet actor = Actor()\nscene.add(actor)\nactor.move(byX: 200, y: 100, duration: 3)\n```\n\n🔌 **Easily extend Imagine Engine with Plugins**\n\nInstead of relying on subclassing and overriding methods, Imagine Engine is designed to be easily extended through plugins. This enables you to share code between different games, and create new open source projects that add new functionality to the engine. You can attach plugins to most of Imagine Engine's objects, here's an example of creating a plugin that creates a new actor every time the scene is clicked or tapped:\n\n```swift\nclass MyPlugin: Plugin {\n    func activate(for scene: Scene, in game: Game) {\n        scene.events.clicked.observe { scene in\n            let actor = Actor()\n            actor.position = scene.center\n            scene.add(actor)\n        }\n    }\n}\n```\n\n🕐 **Precise timing using Timelines**\n\nManaging time and delayed events can sometimes be tricky in game development. Imagine Engine aims to make this a lot easier through its timeline API, that enables you to schedule single or repeated events in the future without having to worry about screen updates or if the game is paused. Here's how you can add an event to spawn a new enemy every 5 seconds:\n\n```swift\nscene.timeline.repeat(withInterval: 5) {\n    let enemy = Actor()\n    enemy.animation = Animation(name: \"Enemy\", frameCount: 5, frameDuration: 0.15)\n    scene.add(enemy)\n}\n```\n\n## Platform support\n\n- [X] 📱 iOS 9 or later\n- [X] 🖥 macOS 10.12 or later\n- [X] 📺 tvOS 10 or later\n\nImagine Engine supports all of Apple's platforms except watchOS. The API is also completely cross platform, so that you don't have to scatter `#if`s all over your game code.\n\n## Xcode templates\n\nImagine Engine ships with Xcode project templates that makes it super easy to get started with a new project. [You can find more information \u0026 installation instructions here](XcodeTemplates).\n\n## Let's get started!\n\nTo get started, check out the [tutorials section](https://github.com/JohnSundell/ImagineEngine/tree/master/Documentation/Tutorials), which contains tutorials that will walk you through building your first Imagine Engine-powered games with very few lines of code. No previous game developer experience required!\n\nIf you need help getting started or have a question about Imagine Engine, feel free to [open an issue](https://github.com/JohnSundell/ImagineEngine/issues/new)! We're a friendly community who would love to get more people involved.\n\nImagine Engine is in active development, with new features being constantly added. Need something new, or want to help out making the engine even more capable? [Browse and create new issues](https://github.com/JohnSundell/ImagineEngine/issues) or [open a PR](https://github.com/JohnSundell/ImagineEngine/pull/new/master).\n\nLets build some awesome games together! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsundell%2Fimagineengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnsundell%2Fimagineengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsundell%2Fimagineengine/lists"}