{"id":15510436,"url":"https://github.com/ananace/angelscriptmp","last_synced_at":"2025-02-24T05:11:49.753Z","repository":{"id":143078600,"uuid":"54986554","full_name":"ananace/AngelscriptMP","owner":"ananace","description":"Testing out making an Angelscript-based framework for scriptable multiplayer games","archived":false,"fork":false,"pushed_at":"2016-04-12T11:52:15.000Z","size":154,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T04:41:32.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/ananace.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-29T15:17:35.000Z","updated_at":"2018-08-23T14:12:38.000Z","dependencies_parsed_at":"2023-04-18T08:47:47.452Z","dependency_job_id":null,"html_url":"https://github.com/ananace/AngelscriptMP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FAngelscriptMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FAngelscriptMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FAngelscriptMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FAngelscriptMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ananace","download_url":"https://codeload.github.com/ananace/AngelscriptMP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240420982,"owners_count":19798502,"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":[],"created_at":"2024-10-02T09:48:46.478Z","updated_at":"2025-02-24T05:11:49.721Z","avatar_url":"https://github.com/ananace.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"LD34\n=====\n\nMy Ludum Dare 34 entry\n\n\nDependencies\n============\n\n- CMake\n- SFML 3.2\n- Angelscript 2.30\n\nExample Script\n---------------\n\n```angelscript\nvoid OnLoad()\n{\n\tClock t;\n}\n\nclass Clock\n{\n\tClock()\n\t{\n\t\tHooks::Add(\"DrawUI\", \"draw\");\n\n\t\tfont = Resources::GetFont(\"arial.ttf\");\n\t\ttarget = Time::At(2015,12,12, 03,00,00);\n\t}\n\t~Clock()\n\t{\n\t\tHooks::Remove(\"DrawUI\");\n\t}\n\n\tstring toString(const Timespan\u0026in span)\n\t{\n\t\tfloat sec = span.Seconds;\n\n\t\tint hours   = int(sec / 3600);\n\t\tint minutes = int(sec % 3600) / 60;\n\t\tint seconds = int(sec % 3600) % 60;\n\n\t\treturn (hours \u003c= 9 ? \"0\" : \"\") + hours + \":\" +\n\t\t\t(minutes \u003c= 9 ? \"0\" : \"\") + minutes + \":\" +\n\t\t\t(seconds \u003c= 9 ? \"0\" : \"\") + seconds;\n\t}\n\n\tvoid draw(sf::Renderer@ rend)\n\t{\n\t\tTimespan remain = (target - Time::Now);\n\n\t\tsf::Text title(\"Time remaining until theme:\\n\");\n\t\ttitle.SetFont(@font.Font);\n\n\t\ttitle.CharacterSize = 20;\n\t\ttitle.Origin = title.LocalBounds.Center;\n\t\ttitle.Position = rend.Center - sf::Vec2(0, 250);\n\n\t\trend.Draw(title);\n\t\ttitle.String = toString(remain);\n\t\ttitle.Origin = title.LocalBounds.Center;\n\n\t\ttitle.Move(sf::Vec2(0, 18));\n\n\t\trend.Draw(title);\n\n\t\t{\n\t\t\tsf::RectangleShape dial(sf::Vec2(5, 100));\n\n\t\t\tfloat timeleft = remain.Seconds;\n\n\t\t\tdial.Origin = sf::Vec2(2.5, 100);\n\t\t\tdial.Position = rend.Center;\n\n\t\t\tdial.Rotation = (timeleft / 3600) * (360 / 12);\n\n\t\t\trend.Draw(dial);\n\n\t\t\tdial.Scale = sf::Vec2(0.75, 1.5);\n\n\t\t\tdial.Rotation = ((timeleft % 3600) / 60) * (360 / 60);\n\n\t\t\trend.Draw(dial);\n\n\t\t\tdial.Scale = sf::Vec2(0.5, 1.75);\n\t\t\tdial.FillColor = sf::Color::Red;\n\n\t\t\tdial.Rotation = ((timeleft % 3600) % 60) * (360 / 60);\n\n\t\t\trend.Draw(dial);\n\t\t}\n\n\t\tsf::RectangleShape face(sf::Vec2(4, 25));\n\t\tface.Origin = sf::Vec2(2, 25);\n\n\t\tconst int j = 24;\n\t\tfor (int i = 0; i \u003c j; ++i)\n\t\t{\n\t\t\tif (i % 2 == 1)\n\t\t\t\tface.Scale = sf::Vec2(0.25, 1);\n\t\t\telse\n\t\t\t\tface.Scale = sf::Vec2(1, 1);\n\n\t\t\tfloat ang = i * (360 / j);\n\n\t\t\tface.Rotation = 90 + ang;\n\t\t\tface.Position = rend.Center +\n\t\t\t\tsf::Vec2(\n\t\t\t\t\tcos(ang * (3.1415/180)) * 150,\n\t\t\t\t\tsin(ang * (3.141519/180)) * 150\n\t\t\t\t);\n\n\t\t\trend.Draw(face);\n\t\t}\n\t}\n\n\tprivate Resources::Font font;\n\tprivate Timestamp nextReport;\n\tprivate Timestamp target;\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fangelscriptmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananace%2Fangelscriptmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fangelscriptmp/lists"}