Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Tiny ECS example - Gideros Forum

Tiny ECS example

rrraptorrrraptor Member
I've been learning how to use tiny esc library for a few days, and came up with this project, and thouth that maybe it will be useful for someone.
Its a little bit dirty in some places, but overall i think its pretty good ;)
Here is a video:


And source:
https://github.com/MultiPain/Gideros-tiny-ECS

P.S. there is a very strange bug, which i can't fix... You can throw weapons only in 2 (or sometimes 3) directions: right, down, down-right.
P.S.S. throwing logic is in "EGun" class, "throw" method :/
Tagged:
+1 -1 (+5 / -0 ) Share on Facebook

Comments

  • antixantix Member
    @rrraptor many thanks for sharing that. I've never used ECS before and now had a bit of a look at it. They are pretty nice but personally I feel they add unnecessary overheads.. even though they do make a lot of other stuff simpler :)
    Follow me on FaceBook Check out my DevBlog, my GitHub, and try my games...
    Falling Animals | Breaky Wall | Exetor | Mini Putt Golfing | Ninja Fruit Master
  • Apollo14Apollo14 Member
    This is great! THANKS!
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
  • rrraptorrrraptor Member
    edited May 9
    antix said:

    I feel they add unnecessary overheads

    Well, for PC it's fine I think, for mobiles ... it will be necessary to test :) I'll do it later, perhaps.

    Btw, entites can be just a simple table like in my debugDrawSystem:
    local ent = {drawable = CDrawable.new("main")}
    ent.drawable:add(Bitmap.new(...))
    world:addEntity(ent)
    I used classes because it seemed convenient for me. Systems also can be simplier:
    local system = tiny.system()
    -- filter can look like that:
    system.filter = tiny.requireAll(...) 
    -- or as function:
    function system:filter(ent)
    	return true
    end
     
    function system:onAdd(ent)
    	-- code
    end
     
    function system:onRemove(ent)
    	-- code
    end
    Project updated.
    Sorted files in repository, added some comments in files, removed anonymous function from "GameScene".

    Likes: antix

    +1 -1 (+1 / -0 ) Share on Facebook
  • rrraptorrrraptor Member
    edited May 10
    Another update. Whats done:
    • Removed an unnecessary check on the static body, because it is excluded by the filter.
    • Overrided tostring method for Vec2
    • Fixed camera positioning when zoomed
    • Added vector limitation for body velocity
    • Removed vector limitation when applying force to the body
    • The camera is now moving more smoothly (thanks to "lerp" function)
    EDIT

    Playing with physics :)

    Likes: Apollo14, talis, antix

    +1 -1 (+3 / -0 ) Share on Facebook
  • Apollo14Apollo14 Member
    Playing with physics
    @rrraptor "video is unavailable :'(
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
  • rrraptorrrraptor Member
    edited May 15
    oleg said:

    clone zombsroyale? http://zombsroyale.io/#_=_ :D

    Nope.
    Apollo14 said:

    video is unavailable :'(

    https://youtu.be/OV0DWE7aNc4

    Likes: Apollo14

    +1 -1 (+1 / -0 ) Share on Facebook
Sign In or Register to comment.