Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic movement for platformer demo #24

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f71004e
chore: update cubos engine to latest version
fallenatlas Nov 12, 2023
7c9cd6c
feat(platformer): add setup and basic movement
fallenatlas Nov 13, 2023
4a71dba
chore: update flake
RiscadoA Nov 13, 2023
a9a9b23
chore: switch to cubos DevGamm branch
RiscadoA Nov 13, 2023
2049382
build: create a root CMakeLists.txt
RiscadoA Nov 13, 2023
5e07ed2
refactor: clean up playerPlugin a bit
RiscadoA Nov 13, 2023
2ddbed2
refactor(platformer): categorize assets
RiscadoA Nov 13, 2023
43adc25
refactor(platformer): use scene for players
RiscadoA Nov 13, 2023
0811eb3
feat(platformer): add tesseratos
RiscadoA Nov 13, 2023
61be934
feat(platformer): add PlayerSpawn and level1
RiscadoA Nov 13, 2023
62a4257
feat(platformer): add orbitCameraPlugin
RiscadoA Nov 13, 2023
4987352
feat(platformer): add character model
RiscadoA Nov 13, 2023
dbb01d9
feat(platformer): add platforms
RiscadoA Nov 13, 2023
5bbfc21
feat(platformer): add colliderGizmoPlugin
RiscadoA Nov 13, 2023
49b7031
feat(platformer): handle collisions
RiscadoA Nov 13, 2023
04674d8
feat(platformer): allow jumping on the platform
RiscadoA Nov 13, 2023
00aa39f
feat(platformer): proper scale and colliders
RiscadoA Nov 13, 2023
036ebd0
feat(platformer): add feet, hands and animation
RiscadoA Nov 13, 2023
03f267e
feat(platformer): implement better movement
fallenatlas Nov 14, 2023
9789ff4
feat(platformer): add OrbitCameraController::speed
RiscadoA Nov 14, 2023
0cf80d6
chore: update cubos
RiscadoA Nov 14, 2023
ae10157
feat(platformer): add camera controls
RiscadoA Nov 14, 2023
450637e
feat(platformer): move some settings to Player component
RiscadoA Nov 14, 2023
1d8f0de
fix(platformer): remove unnecessary localToWorld
luishfonseca Nov 14, 2023
558cb1a
chore: bump cubos
luishfonseca Nov 14, 2023
d5e91cc
feat(platformer): add death and respawn
luishfonseca Nov 14, 2023
da2a96a
feat(platformer): add moving platform
RiscadoA Nov 14, 2023
5492f3c
feat(platformer): add sideways movement to player
fallenatlas Nov 15, 2023
ba9d32f
feat(platformer): add more platforms
fallenatlas Nov 15, 2023
319af0e
feat(platformer): disable colliderGizmosPlugin
RiscadoA Nov 15, 2023
d334bc1
feat(platformer): improve player animation
RiscadoA Nov 15, 2023
0078eb1
feat(platformer): add gamepad
RiscadoA Nov 15, 2023
48f7c40
feat(platformer): add axis deadzones
RiscadoA Nov 15, 2023
7f4d828
feat(platformer): proper moving platforms
RiscadoA Nov 15, 2023
de69849
feat(platformer): add goal
RiscadoA Nov 15, 2023
745d108
feat(platformer): add victory
RiscadoA Nov 15, 2023
cbfa1f8
feat(platformer): add moving with platforms
fallenatlas Nov 15, 2023
7445129
feat(platformer): fix animation
RiscadoA Nov 16, 2023
9627dd2
feat(platformer): add canon and bullet assets
fallenatlas Nov 16, 2023
739482b
feat(platformer): add cannons
RiscadoA Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CMakeLists.txt
# Cubos Demo project root build configuration

cmake_minimum_required(VERSION 3.20.0)
project(cubos-demo VERSION 0.1.0)

add_subdirectory(lib/cubos)
add_subdirectory(platformer)
32 changes: 7 additions & 25 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 31 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
# Flake used for development with nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = import inputs.nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
packages = with pkgs; [
# = build tools =
cmake
gcc
glfw
glm
spdlog
ccache
pkg-config

# = formatting =
clang-tools

# = docs =
doxygen
graphviz
clang_14
(python3.withPackages (ps: [
ps.jinja2
ps.pygments
]))

# = libs =
glfw
glm
# spdlog
# fmt
doctest
lcov

# = system libs =
libGL
xorg.libX11
xorg.libXrandr
xorg.libXinerama
xorg.libXcursor
xorg.libXi
xorg.libXdmcp
];
};
});
Expand Down
2 changes: 1 addition & 1 deletion lib/cubos
Submodule cubos updated 565 files
61 changes: 32 additions & 29 deletions platformer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
# CMakeLists.txt
# Cubos Demo project root build configuration

cmake_minimum_required(VERSION 3.20.0)
project(cubos-platformer-demo VERSION 0.1.0)

# Include CubinhosGenerate
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../lib/cubos/cmake")
include(CubinhosGenerate)

# Build demo executabe
set(PROJECT_SOURCE "main.cpp")
add_executable(platformer_demo ${PROJECT_SOURCE})

# Dependencies
add_subdirectory(../lib/cubos lib/cubos)
target_link_libraries(platformer_demo cubos-engine)

# Assets
target_compile_definitions(platformer_demo PUBLIC PROJECT_ASSETS_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/assets")

target_compile_features(platformer_demo PRIVATE cxx_std_20)

# Components
cubinhos_generate(platformer_demo "${CMAKE_CURRENT_SOURCE_DIR}")

# Enable CTest and CPack
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
# Platformer build configuration

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../lib/cubos/cmake")

include(QuadradosGenerate)

add_executable(platformer
src/main.cpp
src/player/plugin.cpp
src/player/player.cpp
src/spawn/plugin.cpp
src/spawn/spawn.cpp
src/orbit_camera/plugin.cpp
src/orbit_camera/controller.cpp
src/collider_gizmos/plugin.cpp
src/offset/plugin.cpp
src/offset/offset.cpp
src/death/plugin.cpp
src/death/dead.cpp
src/mover/plugin.cpp
src/mover/mover.cpp
src/victory/plugin.cpp
src/victory/victory.cpp
src/cannon/plugin.cpp
src/cannon/cannon.cpp
src/cannon/bullet.cpp
)

target_link_libraries(platformer tesseratos)
target_compile_definitions(platformer PUBLIC PROJECT_ASSETS_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/assets")
target_compile_features(platformer PRIVATE cxx_std_20)
quadrados_generate(platformer "${CMAKE_CURRENT_SOURCE_DIR}")
69 changes: 69 additions & 0 deletions platformer/assets/bindings/player0.bind
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"actions": {
"jump": {
"keys": [
"Space"
],
"gamepad": [
"A"
]
}
},
"axes": {
"vertical": {
"pos": [
"s"
],
"neg": [
"w"
],
"gamepad": [
"LY"
]
},
"horizontal": {
"pos": [
"d"
],
"neg": [
"a"
],
"gamepad": [
"LX"
]
},
"look-vertical": {
"pos": [
"Down"
],
"neg": [
"Up"
],
"gamepad": [
"RY"
]
},
"look-horizontal": {
"pos": [
"Right"
],
"neg": [
"Left"
],
"gamepad": [
"RX"
]
},
"look-zoom": {
"pos": [
"PageUp"
],
"neg": [
"PageDown"
],
"gamepad": [
"RTrigger"
]
}
}
}
3 changes: 3 additions & 0 deletions platformer/assets/bindings/player0.bind.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "1c2497cc-3aec-4455-889f-492001172273"
}
69 changes: 69 additions & 0 deletions platformer/assets/bindings/player1.bind
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"actions": {
"jump": {
"keys": [
"p"
],
"gamepad": [
"A"
]
}
},
"axes": {
"vertical": {
"pos": [
"g"
],
"neg": [
"t"
],
"gamepad": [
"LY"
]
},
"horizontal": {
"pos": [
"h"
],
"neg": [
"f"
],
"gamepad": [
"LX"
]
},
"look-vertical": {
"pos": [
"k"
],
"neg": [
"i"
],
"gamepad": [
"RY"
]
},
"look-horizontal": {
"pos": [
"l"
],
"neg": [
"j"
],
"gamepad": [
"RX"
]
},
"look-zoom": {
"pos": [
"u"
],
"neg": [
"o"
],
"gamepad": [
"RTrigger"
]
}
}
}
3 changes: 3 additions & 0 deletions platformer/assets/bindings/player1.bind.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "093597a1-771b-4196-878c-3ef5c3e27845"
}
Binary file added platformer/assets/main.pal
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/main.pal.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "1aa5e234-28cb-4386-99b4-39386b0fc215"
}
Binary file added platformer/assets/models/cannon/bullet.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/cannon/bullet.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "8f633d2c-618c-40ca-859d-fe24b9ed7200"
}
Binary file added platformer/assets/models/cannon/bullet.qb
Binary file not shown.
Binary file added platformer/assets/models/cannon/cannon.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/cannon/cannon.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "8f633d2c-618c-40ca-859d-fe24b9ed7219"
}
Binary file added platformer/assets/models/cannon/cannon.qb
Binary file not shown.
Binary file added platformer/assets/models/platforms/base-16.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/platforms/base-16.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "e8b952de-41ce-4c63-bd0c-af2c6b501882"
}
Binary file added platformer/assets/models/platforms/base-16.qb
Binary file not shown.
Binary file added platformer/assets/models/platforms/goal.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/platforms/goal.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "1e314618-950c-4505-a275-5881102f8d71"
}
Binary file added platformer/assets/models/platforms/goal.qb
Binary file not shown.
Empty file.
Binary file added platformer/assets/models/player/left-foot.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/player/left-foot.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "8f633d2c-618c-40ca-859d-fe24b9ed7207"
}
Binary file added platformer/assets/models/player/left-foot.qb
Binary file not shown.
Binary file added platformer/assets/models/player/left-hand.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/player/left-hand.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "ffbf1f87-6ffb-4395-8a30-92883f14dd4a"
}
Binary file added platformer/assets/models/player/left-hand.qb
Binary file not shown.
Binary file added platformer/assets/models/player/right-foot.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/player/right-foot.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "6b49fb4e-3d0d-4784-846f-ae4a6fe0bcbf"
}
Binary file added platformer/assets/models/player/right-foot.qb
Binary file not shown.
Binary file added platformer/assets/models/player/right-hand.grd
Binary file not shown.
3 changes: 3 additions & 0 deletions platformer/assets/models/player/right-hand.grd.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "521cec89-3392-450c-90f5-a06e1abd1691"
}
Binary file added platformer/assets/models/player/right-hand.qb
Binary file not shown.
Binary file added platformer/assets/models/player/torso.grd
Binary file not shown.
Loading