Giter Club home page Giter Club logo

zetgame's Introduction

zetgame's People

Contributors

jespa007 avatar

Stargazers

 avatar

Watchers

 avatar

zetgame's Issues

Implement Collider2d

Support
Will perform square-square circle-circle or rectangle-circle collsions, using a collider per entity or per frame defined by the animation.

User configuration

Once entity type is defined by user, pass entity type origina and all entity type that will collide with. For example,

// first define animations and its frames

// second define its
EntityType * bullets = newEntityHandler((EntityData){
   max=MAX_ENTITY_BULLETS
   ,scene=Scene
   ,animation2d=animation2d
  ,name="bullet"
 ,collider=[sphere/quad,etc]
  ,...
});

EntityType * players = newEntityHandler((EntityData){
   max=MAX_ENTITY_PLAYERS
   ,scene=Scene
   ,animation2d=animation2d
  ,name="player"
  ,...
});

PhysicsCollision.RegisterManagerCollisionTargets((EntityData){
         src_entity=this.players
        ,collision_targets=std::vector<CollisionTarget>{
	                // ... these entity manager targets
			,{
				dest_entity: bullets
				,on_collision_begin:{
					callback_function:[](player,bullet){
						bullet.fixation_time=dartboard.getActiveTime()+scene.dartboard_level_properties.fixation_time;
						bullet.inside=true;
					}
				}
				,on_collision_end:{
					callback_function:[](player,bullet){
						bullet.inside=false;
					}
				}
			},{

                       }
[cute_c2.txt](https://github.com/jespa007/zetgame/files/6934662/cute_c2.txt)


});

Texture manager

Implement a function Texture_GetTexture that given texture_name with extension it loads from path and it stores in internal map.

Implement managing for GUIWindow

It will load a window from xml pattern,

As example,

<window background-color="#0F0F0F" window-style="none">
<!--	<label top=200 left=20 text="Have we had the right choice ?" font_name="ArmWrestler.ttf" font_color=#23b9d8 font_size=60></label>-->
	<label id="lbl_score" 
		left="10" top="10" height="25" 
	    text="general.score" 
	    font-size="20" font-color="#FFFFFF"
	></label>	
	
	<label id="lbl_exp" 
		left="10" top="35" height="25" 
	   font-size="20" font-color="#FFFFFF"
	></label>

	<img id="img_time_left" 
		left="10" top="55" height="25"
		 src="clock.png" 
	></img>		
	    
	<label id="lbl_time_left" 
		left="38" top="60" height="25"
		text="general.time_left"  
	    font-size="20" font-color="#FFFFFF"
	></label>		
</window>

In the programe will do,

GUIWindow *win=GUIWindow_Get("app/window.xml"); // will load with keyname windows.xml

and then implement or change its texts,

GUILabel_SetText(GUIWindow_Get(win ,"lbl_time_left"),"Hello");

Implement Scene

Will update,

  • Entity component system
  • Gui system
  • Audio system
  • Physics system

Implement register components

In order to register components it proposes the autometic adding using macros

#define ZG_ECS_REGISTER_COMPONENT(_entity_system, _data, _extra_options) \
ComponentId __g_entity_system_component#_data=__g_entity_system_component++;\
EntitySystem_RegisterComponentBuiltin(__g_entity_system_component#_data,(EntitySystemRegisterEComponent){\
		.size_data				=sizeof(_data)\
		,.required_components	=_extra_options!=NULL?_extra_options->_required_components:NULL\
		,.EComponent_OnCreate	=_extra_options!=NULL?_extra_options->on_create:NULL\
		,.EComponent_OnUpdate	=_extra_options!=NULL?_extra_options->on_update:NULL\
		,.EComponent_OnDestroy	=_extra_options!=NULL?_extra_options->on_destroy:NULL\
	}

Implement SpriteKeyFrame

Description

Will add load frames information taking texture input and other information for each frame. For example collider information.

New component allocation behaviour on extend entities

Entity Manager acts as ArchyTime where it set the number of required components and the amount of number of entities at start (default 1). If there's no more entities to add it ok but in case it has to extends,

Entity manager extends components by the number of required entities, it calls on create function

If any entities are required to be extend, it will be call on_destroy (if it exists) delete component array, rellocating by the new extension and calling on_create function

It can cause a performance penalty (so the function extends entities will exist but not recomended to use)

restruct project

  • add src and move all source into src dir
  • build project to build/[gcc/mvc] respectively
  • modify cmakefile.txt accordely

Fast component iteration

In order to have fast component iterations, it proposes to have components packed to avoid gaps and check for "entity is active" between each iteration. The technique is by swapping components data from entities that it creates or dies (descrived on game Programming Patterns Data Locality).

That will require an array that has reference of which components id it refers of.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.