EXECDIR = .
SRCDIR = src
-OUTDIR = out
+OUTDIR = build
SRCEXT = cpp
OBJEXT = o
DEPEXT = d
resources: directories
-directories:
+directories:
@mkdir -p $(EXECDIR)
@mkdir -p $(OUTDIR)
@echo " CXX " $<
@mkdir -p $(dir $@)
@$(CXX) $(CXXFLAGS) $(CXXINCS) -c -o $@ $<
- @$(CXX) $(CXXFLAGS) $(INCDEP) -MM $(SRCDIR)/$*.$(SRCEXT) > $(OUTDIR)/$*.$(DEPEXT)
+ @$(CXX) $(CXXFLAGS) $(CXXINCS) $(INCDEP) -MM $(SRCDIR)/$*.$(SRCEXT) > $(OUTDIR)/$*.$(DEPEXT)
@cp -f $(OUTDIR)/$*.$(DEPEXT) $(OUTDIR)/$*.$(DEPEXT).tmp
@sed -e 's|.*:|$(OUTDIR)/$*.$(OBJEXT):|' < $(OUTDIR)/$*.$(DEPEXT).tmp > $(OUTDIR)/$*.$(DEPEXT)
@sed -e 's/.*://' -e 's/\\$$//' < $(OUTDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(OUTDIR)/$*.$(DEPEXT)
Player = 0,
EventListeners = {
MoveLeftPressed = function(self)
- --self.Velocity.x = self.Velocity.x - 3.0
- self.Velocity.y = self.Velocity.y - 1.0
+ self.Velocity.x = self.Velocity.x - 3.0
self.Render.flipx = true;
end,
MoveLeftReleased = function(self)
-- TODO can't put text at world coordinates right now
--game.puts("default", self.Position.x, self.Position.y+100, "Hey. Hag?")
- --self.Velocity.x = self.Velocity.x + 3.0
- self.Velocity.y = self.Velocity.y + 1.0
+ self.Velocity.x = self.Velocity.x + 3.0
end,
MoveRightPressed = function(self)
- --self.Velocity.x = self.Velocity.x + 3.0
- self.Velocity.y = self.Velocity.y + 1.0
+ self.Velocity.x = self.Velocity.x + 3.0
self.Render.flipx = false;
end,
MoveRightReleased = function(self)
- --self.Velocity.x = self.Velocity.x - 3.0
- self.Velocity.y = self.Velocity.y - 1.0
+ self.Velocity.x = self.Velocity.x - 3.0
end,
JumpKeyPressed = function(self)
- if self.Physics.standing == true then
- game.play(self.Position, self.Audio)
- self.Velocity.y = self.Velocity.y + 9
- end
+ -- if self.Physics.standing == true then
+ -- game.play(self.Position, self.Audio)
+ -- self.Velocity.y = self.Velocity.y + 9
+ -- end
+ self.Velocity.y = self.Velocity.y + 3.0
end,
JumpKeyReleased = function(self)
+ self.Velocity.y = self.Velocity.y - 3.0
+ end,
+ CrouchKeyPressed = function(self)
+ self.Velocity.y = self.Velocity.y - 3.0
+ end,
+ CrouchKeyReleased = function(self)
+ self.Velocity.y = self.Velocity.y + 3.0
end
},
Position = {
-Subproject commit 3989cf4cf81da1077a501a1d53e6114f55b812f9
+Subproject commit e04b856006cfe6b7e8ba5d6c1434331351cc791a
el.tryListener("JumpKeyPressed",
e.component<Scripted>()->caller);
});
+ } else if (kue.sym == SDLK_LSHIFT) {
+ entities.each<EventListener>(
+ [](entityx::Entity e, EventListener& el) {
+ el.tryListener("CrouchKeyPressed",
+ e.component<Scripted>()->caller);
+ });
}
}
}
el.tryListener("JumpKeyReleased",
e.component<Scripted>()->caller);
});
+ } else if (kue.sym == SDLK_LSHIFT) {
+ entities.each<EventListener>(
+ [](entityx::Entity e, EventListener& el) {
+ el.tryListener("CrouchKeyReleased",
+ e.component<Scripted>()->caller);
+ });
}
}
}
void World::generateMesh()
{
for (auto &l : drawLayers) {
-
+
// Preallocate size of vertexes
float Z = l->drawLayer;
0 , 0+h, Z, to.x , to.y , tr};
glBindBuffer(GL_ARRAY_BUFFER, l->layerVBO);
- glBufferData(GL_ARRAY_BUFFER,
- 36 * sizeof(GLfloat),
- mesh,
+ glBufferData(GL_ARRAY_BUFFER,
+ 36 * sizeof(GLfloat),
+ mesh,
GL_STATIC_DRAW);
meshAdd.push_back(WorldMeshUpdateEvent(l->layerVBO,
if (i == 0.0f) {
std::cout << inter.size() << std::endl;
if (inter.size()) {
- p.standing = true;
+ // p.standing = true;
}
}