added a test that goes across boundaries
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "component.h"
|
||||
|
||||
#ifndef LIB_EXPORT
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
@@ -32,3 +33,10 @@ LIB_EXPORT typename entt::registry<>::component_type a_module_char_type() {
|
||||
|
||||
return registry.type<char>();
|
||||
}
|
||||
|
||||
LIB_EXPORT void update_position(int delta, entt::registry<> ®istry) {
|
||||
registry.view<position, velocity>().each([delta](auto &pos, auto &vel) {
|
||||
pos.x += delta * vel.dx;
|
||||
pos.y += delta * vel.dy;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user