modified assets for the new physics simulation engine, added velocity readouts to top left of HUD
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "little guy",
|
"name": "little guy",
|
||||||
"movementspeed": 8,
|
"speedtime": 8,
|
||||||
"velocity_x": 1,
|
"acceleration_x": 0.001,
|
||||||
"velocity_y": 1,
|
"acceleration_y": 0.001,
|
||||||
|
"speed_x": 1,
|
||||||
|
"speed_y": 1,
|
||||||
"sprite_mappings": [
|
"sprite_mappings": [
|
||||||
{
|
{
|
||||||
"state": [
|
"state": [
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "menupointer",
|
"name": "menupointer",
|
||||||
"movementspeed": 8,
|
"speedtime": 8,
|
||||||
"velocity_x": 0,
|
"speed_x": 0,
|
||||||
"velocity_y": 0,
|
"speed_y": 0,
|
||||||
|
"acceleration_x": 0,
|
||||||
|
"acceleration_y": 0,
|
||||||
"sprite_mappings": [
|
"sprite_mappings": [
|
||||||
{
|
{
|
||||||
"state": [
|
"state": [
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"some.key.with.a.value": "value",
|
"some.key.with.a.value": "value",
|
||||||
"game.screenwidth": "640",
|
"game.screenwidth": "640",
|
||||||
"game.screenheight": "480"
|
"game.screenheight": "480",
|
||||||
|
"physics.gravity.y": "32.0",
|
||||||
|
"physics.gravity.terminal_y": "120.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
{
|
{
|
||||||
"name":"state",
|
"name":"state",
|
||||||
"type":"int",
|
"type":"int",
|
||||||
"value":24
|
"value":1041
|
||||||
}],
|
}],
|
||||||
"rotation":0,
|
"rotation":0,
|
||||||
"type":"actor",
|
"type":"actor",
|
||||||
|
|||||||
2
deps/libakgl
vendored
2
deps/libakgl
vendored
Submodule deps/libakgl updated: d87c5d2c20...314ce5e10d
@@ -1,4 +1,5 @@
|
|||||||
#include <akgltest.h>
|
#include <akgltest.h>
|
||||||
|
#include <akgl/game.h>
|
||||||
|
|
||||||
akerr_ErrorContext AKERR_NOIGNORE *akgltest_set_gamemode_menu(akgl_Actor *appstate, SDL_Event *event)
|
akerr_ErrorContext AKERR_NOIGNORE *akgltest_set_gamemode_menu(akgl_Actor *appstate, SDL_Event *event)
|
||||||
{
|
{
|
||||||
@@ -148,26 +149,53 @@ akerr_ErrorContext AKERR_NOIGNORE *akgltest_iterate_running(void)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
akgl_Iterator opflags;
|
akgl_Iterator opflags;
|
||||||
|
akgl_Actor *player;
|
||||||
|
TTF_Font *gamefont;
|
||||||
char fpsText[32];
|
char fpsText[32];
|
||||||
|
char velocityText[128];
|
||||||
|
int count;
|
||||||
|
|
||||||
PREPARE_ERROR(e);
|
PREPARE_ERROR(e);
|
||||||
PASS(e, renderer.frame_start(&renderer));
|
PASS(e, renderer.frame_start(&renderer));
|
||||||
|
player = SDL_GetPointerProperty(AKGL_REGISTRY_ACTOR, "player", NULL);
|
||||||
|
FAIL_ZERO_RETURN(e, player, AKERR_NULLPOINTER, "player not in registry");
|
||||||
|
gamefont = SDL_GetPointerProperty(AKGL_REGISTRY_FONT, "C64Pro", NULL);
|
||||||
|
FAIL_ZERO_RETURN(e, player, AKERR_NULLPOINTER, "font not in registry");
|
||||||
|
|
||||||
PASS(e, akgl_game_update(NULL));
|
PASS(e, akgl_game_update(NULL));
|
||||||
|
|
||||||
memset((char *)&fpsText, 0x00, 32);
|
memset((char *)&fpsText, 0x00, 32);
|
||||||
snprintf((char *)&fpsText, 31, "FPS : %d", game.fps);
|
snprintf((char *)&fpsText, 31, "FPS : %d", game.fps);
|
||||||
PASS(e, akgl_text_rendertextat(
|
PASS(e, akgl_text_rendertextat(
|
||||||
SDL_GetPointerProperty(
|
gamefont,
|
||||||
AKGL_REGISTRY_FONT,
|
|
||||||
"C64Pro",
|
|
||||||
NULL),
|
|
||||||
(char *)&fpsText,
|
(char *)&fpsText,
|
||||||
(SDL_Color){255, 255, 255, 255},
|
(SDL_Color){255, 255, 255, 255},
|
||||||
0,
|
0,
|
||||||
450,
|
450,
|
||||||
10)
|
10)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
memset((char *)&velocityText, 0x00, 128);
|
||||||
|
snprintf((char *)&velocityText, 127, "AX: %f", player->vx);
|
||||||
|
PASS(e, akgl_text_rendertextat(
|
||||||
|
gamefont,
|
||||||
|
(char *)&velocityText,
|
||||||
|
(SDL_Color){255, 255, 255, 255},
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
10)
|
||||||
|
);
|
||||||
|
memset((char *)&velocityText, 0x00, 128);
|
||||||
|
snprintf((char *)&velocityText, 127, "AY: %f", player->vy);
|
||||||
|
PASS(e, akgl_text_rendertextat(
|
||||||
|
gamefont,
|
||||||
|
(char *)&velocityText,
|
||||||
|
(SDL_Color){255, 255, 255, 255},
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
30)
|
||||||
|
);
|
||||||
|
|
||||||
PASS(e, renderer.frame_end(&renderer));
|
PASS(e, renderer.frame_end(&renderer));
|
||||||
SUCCEED_RETURN(e);
|
SUCCEED_RETURN(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user