foxid ~master

2D framework for Game develop


To use this package, run the following command in your project's root directory:

<p align="center"><img src="https://i.imgur.com/zLedNC4.png" /> </p> <p align="center"><a href="https://todnaz.github.io/foxid.github.io/">API Docs</a> | <a href="https://github.com/TodNaz/Foxid/issues">Ask a question or report a bug</a> | <a href="https://github.com/TodNaz/Foxid/tree/master/examples">Example's</a></p> <p align="center"><a href="https://travis-ci.org/TodNaz/Foxid"><img src="https://img.shields.io/travis/TodNaz/Foxid?logo=travis&style=flat-square" /></a> <a href="https://github.com/TodNaz/Foxid/actions"><img src="https://img.shields.io/github/workflow/status/TodNaz/Foxid/CI?logo=github&style=flat-square" /></a> <img src="https://img.shields.io/dub/l/foxid?style=flat-square" /> <a href="https://discord.gg/gtXt3G"><img src="https://img.shields.io/discord/765461051029585942?label=Foxid&logo=Discord&logoColor=white&style=flat-square" /></a> <img src="https://img.shields.io/badge/foxid-v0.3.1-orange.svg?style=flat-square" /></p>


Foxid is a 2D game development framework. Here are the possibilities it provides:

  • Easy development of the game using a system of scene-instances, with which the logic does not become less difficult:
import foxid;

class Player : Instance
{
    override void event(Event event) @safe
    {
        if(event.getKeyDown == Key.left) ...
    }
}

class MainScene : Scene
{
    this() @safe
    {
        add(new Player());
    }
    
    debug void drawDebug(Display graph) @safe
    {
        graph.drawTextEx("Debug draw: $(#000000)Text",...);
    }
}

int main(string[] args) @safe
{
    GameRun!(640,480,"Test",MainScene);
}
  • Lightweight API for development:
Vector!(int)[] tree = findPath(gridPath,Vector!int(128,128),Vector!int(640,32));
size_t curr = 0;
while(curr != tree.length) {
    if(position.distanceToPoint(Vec(tree[curr].x,tree[curr].y)) < 3) {
        position.moveTo(Vec(tree[curr].x,tree[curr].y));
        curr++;
    }
}
  • A handy resource loader that remembers what you loaded, and now you don't have to create new variables to remember them:
loader.load!Image("my_image.png","myImage");
graph.draw(loader.get!Image("myImage"));

loader.load!Image([
    "myImage" : "my_image.png",
    "otherImage" : "other_image.png"
]);
  • Cross-platform framework with SDL 2 (Window, Linux, Mac OS)

Foxid project creation

Create a project using the dub package manager:

$ dub init myproject

And follow the instructions:

Package recipe format (sdl/json) [json]:
Name [myproject]:
Description [A minimal D application.]: My first project
Author name [imadev]: My Name
License [proprietary]: Boost
Copyright string [Copyright © 2017, imadev]:
Add dependency (leave empty to skip) []: foxid

Foxid includes dependencies:

Next, we will go into the project and write the code to easily open a window in app.d:

import foxid;

void main(string[] args)
{
    GameRun!(640,480,"Test");
}

License

MIT License

Copyright (c) 2020 TodNaz

Permission 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE 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.

Authors:
  • TodNaz
Sub packages:
foxid:helloworld, foxid:guitest
Dependencies:
bindbc-opengl, fmath, silly, bindbc-sdl
Versions:
0.3.1 2020-Oct-12
0.3.0 2020-Oct-06
0.2.3 2020-Sep-12
0.2.2 2020-Sep-11
0.2.1 2020-Aug-29
Show all 17 versions
Download Stats:
  • 0 downloads today

  • 9 downloads this week

  • 57 downloads this month

  • 158 downloads total

Score:
1.2
Short URL:
foxid.dub.pm