Particle Game Maker Engine  1.0.0
Enables the user to create their own particle game using a simple and coherent api in the PongChamp scripting language
engine_capi.h
Go to the documentation of this file.
1 #ifndef __ENGINECPP_CAPI_H__
2 #define __ENGINECPP_CAPI_H__
3 
4 #include "engine_graphics_api.h"
5 #include "engine_main_api.h"
6 #include "engine_particle_api.h"
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
16  typedef GraphicsAPI::LayoutBuilder *LayoutBuilderPtr;
22 
23 #else
24 typedef void *enginePtr;
25 typedef void *HandlePtr;
26 typedef void *BuilderPtr;
27 typedef void *LayoutBuilderPtr;
28 #endif
29 
38 
43 
47  BuilderPtr withColor(BuilderPtr builder, int r, int g, int b);
48 
52  BuilderPtr withName(BuilderPtr builder, const char* name);
53 
57  void freeHandle(HandlePtr handle);
58 
59  // Collision function objects exposed
60  void onCollision_Delete(HandlePtr from, HandlePtr to, bool deleteFrom, bool deleteTo);
61  void onCollision_Create(HandlePtr from, HandlePtr to, int createFrom, int createTo);
62  void onCollision_Move(HandlePtr from, HandlePtr to, int xFromStep, int yFromStep, int xToStep, int yToStep);
63  void onCollision_Convert(HandlePtr from, HandlePtr to, HandlePtr newFromType, HandlePtr newToType);
64  void onCollision_MoveRandom(HandlePtr from, HandlePtr to, unsigned int radius);
65 
66  // Update function objects exposed
67  void onUpdate_Move(HandlePtr group, int framesPerUpdate, int updateLimit, int xStep, int yStep);
68  void onUpdate_Lifetime(HandlePtr group, int framesPerUpdate, int updateLimit, int framesAlive);
69  void onUpdate_RandomMove(HandlePtr group, int framesPerUpdate, int updateLimit, int xRange, int yRange);
70  void onUpdate_Create(HandlePtr group, int framesPerUpdate, int updateLimit, HandlePtr newParticle, int count, int xOff, int yOff, int xRange, int yRange);
71 
75  LayoutBuilderPtr withSize(LayoutBuilderPtr builder, int w, int h);
79  LayoutBuilderPtr withWindowRatio(LayoutBuilderPtr builder, int particlePCT);
81  LayoutBuilderPtr withParticleSize(LayoutBuilderPtr builder, int particleSize);
82 
83  // run the game with the given layout
84  void runWithLayout(LayoutBuilderPtr builder);
85 
86 
87 #ifdef __cplusplus
88 }
89 #endif // !__cplusplus
90 
91 #endif // !__ENGINECPP_CAPI_H__
LayoutBuilderPtr withWindowRatio(LayoutBuilderPtr builder, int particlePCT)
configure size of particle placing portion of the window. input is the percentage that will take up ...
Definition: engine_capi.cpp:80
void onUpdate_Create(HandlePtr group, int framesPerUpdate, int updateLimit, HandlePtr newParticle, int count, int xOff, int yOff, int xRange, int yRange)
Definition: engine_capi.cpp:65
void onUpdate_Lifetime(HandlePtr group, int framesPerUpdate, int updateLimit, int framesAlive)
Definition: engine_capi.cpp:55
void onUpdate_Move(HandlePtr group, int framesPerUpdate, int updateLimit, int xStep, int yStep)
Definition: engine_capi.cpp:50
void onCollision_MoveRandom(HandlePtr from, HandlePtr to, unsigned int radius)
Definition: engine_capi.cpp:46
void onCollision_Move(HandlePtr from, HandlePtr to, int xFromStep, int yFromStep, int xToStep, int yToStep)
Definition: engine_capi.cpp:38
void onCollision_Delete(HandlePtr from, HandlePtr to, bool deleteFrom, bool deleteTo)
Definition: engine_capi.cpp:28
void freeHandle(HandlePtr handle)
Definition: engine_capi.cpp:8
BuilderPtr withName(BuilderPtr builder, const char *name)
Definition: engine_capi.cpp:23
LayoutBuilderPtr buildLayout()
start to build a layout
Definition: engine_capi.cpp:70
BuilderPtr buildParticleGroup()
Definition: engine_capi.cpp:13
HandlePtr createParticleGroup(BuilderPtr builder)
Definition: engine_capi.cpp:3
LayoutBuilderPtr withParticleSize(LayoutBuilderPtr builder, int particleSize)
configure the size of particles (default 3)
Definition: engine_capi.cpp:97
LayoutBuilderPtr withEditorOrientation(LayoutBuilderPtr builder, int orient)
configure whether horizontal or vertical orientation for the editor
Definition: engine_capi.cpp:85
LayoutBuilderPtr withSize(LayoutBuilderPtr builder, int w, int h)
set size of layout
Definition: engine_capi.cpp:75
void onUpdate_RandomMove(HandlePtr group, int framesPerUpdate, int updateLimit, int xRange, int yRange)
Definition: engine_capi.cpp:60
void * BuilderPtr
Definition: engine_capi.h:26
Definition: ParticleGroupBuilder.h:6
void * HandlePtr
Definition: engine_capi.h:25
void onCollision_Create(HandlePtr from, HandlePtr to, int createFrom, int createTo)
Definition: engine_capi.cpp:33
Definition: ParticleGroupHandle.h:29
void * LayoutBuilderPtr
Definition: engine_capi.h:27
void runWithLayout(LayoutBuilderPtr builder)
Definition: engine_capi.cpp:102
void onCollision_Convert(HandlePtr from, HandlePtr to, HandlePtr newFromType, HandlePtr newToType)
Definition: engine_capi.cpp:42
BuilderPtr withColor(BuilderPtr builder, int r, int g, int b)
Definition: engine_capi.cpp:18
void * enginePtr
Definition: engine_capi.h:24