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

Origin/lumberjack #68

Merged
merged 27 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
69badb2
Adding Lumbjack Mode
MrTroyD Aug 12, 2023
bb8fe66
Merge branch 'main' into origin/lumberjack
MrTroyD Aug 12, 2023
a6cd3c5
Created Player file
MrTroyD Aug 13, 2023
614aacc
Another sloppy commit
MrTroyD Aug 14, 2023
59dbf37
Added Secret Character
MrTroyD Aug 26, 2023
26ce3e8
Enemy update
MrTroyD Aug 27, 2023
2fa1856
Loading and Spawning Update
MrTroyD Aug 27, 2023
de12212
Merge branch 'main' into origin/lumberjack
MrTroyD Aug 27, 2023
39a0106
Added enemy ghost
MrTroyD Aug 28, 2023
c8e4086
Enemy cleanup
MrTroyD Aug 28, 2023
c7e561f
Merge branch 'main' into origin/lumberjack
MrTroyD Aug 29, 2023
c30664d
Merge branch 'main' into origin/lumberjack
MrTroyD Sep 3, 2023
c985675
Adjusted everything in an attempt to make development easier
MrTroyD Sep 5, 2023
8952365
Adding notes and undoing things
MrTroyD Sep 5, 2023
67d1688
Declare LUM_TAG in a c file, extern in a header
AEFeinstein Sep 5, 2023
e2e3b76
Formatting
AEFeinstein Sep 5, 2023
289ba82
Fix OOB bug
AEFeinstein Sep 6, 2023
c6e7a8f
Remove binary files
AEFeinstein Sep 6, 2023
1af329e
Collision update
MrTroyD Sep 7, 2023
5a5ded1
Merge branch 'main' into origin/lumberjack
MrTroyD Sep 8, 2023
8469653
Merge branch 'main' into origin/lumberjack
MrTroyD Sep 9, 2023
2064b9b
Tests of ESP_NOW
MrTroyD Sep 9, 2023
e05ce3e
Added character select to menu
MrTroyD Sep 10, 2023
16f16ec
Additional ESP_NOW tests
MrTroyD Sep 15, 2023
671951d
Autoformat
AEFeinstein Sep 15, 2023
fae02d3
Revert button order
AEFeinstein Sep 15, 2023
99c23b2
Remove dangling word
AEFeinstein Sep 15, 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
Binary file removed assets/fonts/radiostars.font.png
Binary file not shown.
Binary file added assets/lumbers/alert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/bottom_floor9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_a7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lumbers/enemy_b7.png
Binary file added assets/lumbers/enemy_c1.png
Binary file added assets/lumbers/enemy_c2.png
Binary file added assets/lumbers/enemy_c3.png
Binary file added assets/lumbers/enemy_c4.png
Binary file added assets/lumbers/enemy_c5.png
Binary file added assets/lumbers/enemy_c6.png
Binary file added assets/lumbers/enemy_c7.png
Binary file added assets/lumbers/enemy_d1.png
Binary file added assets/lumbers/enemy_d2.png
Binary file added assets/lumbers/lumbers_green_1.png
Binary file added assets/lumbers/lumbers_green_10.png
Binary file added assets/lumbers/lumbers_green_11.png
Binary file added assets/lumbers/lumbers_green_12.png
Binary file added assets/lumbers/lumbers_green_13.png
Binary file added assets/lumbers/lumbers_green_14.png
Binary file added assets/lumbers/lumbers_green_15.png
Binary file added assets/lumbers/lumbers_green_16.png
Binary file added assets/lumbers/lumbers_green_17.png
Binary file added assets/lumbers/lumbers_green_18.png
Binary file added assets/lumbers/lumbers_green_19.png
Binary file added assets/lumbers/lumbers_green_2.png
Binary file added assets/lumbers/lumbers_green_20.png
Binary file added assets/lumbers/lumbers_green_21.png
Binary file added assets/lumbers/lumbers_green_3.png
Binary file added assets/lumbers/lumbers_green_4.png
Binary file added assets/lumbers/lumbers_green_5.png
Binary file added assets/lumbers/lumbers_green_6.png
Binary file added assets/lumbers/lumbers_green_7.png
Binary file added assets/lumbers/lumbers_green_8.png
Binary file added assets/lumbers/lumbers_green_9.png
Binary file added assets/lumbers/lumbers_red_1.png
Binary file added assets/lumbers/lumbers_red_10.png
Binary file added assets/lumbers/lumbers_red_11.png
Binary file added assets/lumbers/lumbers_red_12.png
Binary file added assets/lumbers/lumbers_red_13.png
Binary file added assets/lumbers/lumbers_red_14.png
Binary file added assets/lumbers/lumbers_red_15.png
Binary file added assets/lumbers/lumbers_red_16.png
Binary file added assets/lumbers/lumbers_red_17.png
Binary file added assets/lumbers/lumbers_red_2.png
Binary file added assets/lumbers/lumbers_red_3.png
Binary file added assets/lumbers/lumbers_red_4.png
Binary file added assets/lumbers/lumbers_red_5.png
Binary file added assets/lumbers/lumbers_red_6.png
Binary file added assets/lumbers/lumbers_red_7.png
Binary file added assets/lumbers/lumbers_red_8.png
Binary file added assets/lumbers/lumbers_red_9.png
Binary file added assets/lumbers/secret_swadgeland_1.png
Binary file added assets/lumbers/secret_swadgeland_10.png
Binary file added assets/lumbers/secret_swadgeland_11.png
Binary file added assets/lumbers/secret_swadgeland_12.png
Binary file added assets/lumbers/secret_swadgeland_13.png
Binary file added assets/lumbers/secret_swadgeland_14.png
Binary file added assets/lumbers/secret_swadgeland_15.png
Binary file added assets/lumbers/secret_swadgeland_16.png
Binary file added assets/lumbers/secret_swadgeland_17.png
Binary file added assets/lumbers/secret_swadgeland_18.png
Binary file added assets/lumbers/secret_swadgeland_19.png
Binary file added assets/lumbers/secret_swadgeland_2.png
Binary file added assets/lumbers/secret_swadgeland_20.png
Binary file added assets/lumbers/secret_swadgeland_21.png
Binary file added assets/lumbers/secret_swadgeland_22.png
Binary file added assets/lumbers/secret_swadgeland_3.png
Binary file added assets/lumbers/secret_swadgeland_4.png
Binary file added assets/lumbers/secret_swadgeland_5.png
Binary file added assets/lumbers/secret_swadgeland_6.png
Binary file added assets/lumbers/secret_swadgeland_7.png
Binary file added assets/lumbers/secret_swadgeland_8.png
Binary file added assets/lumbers/secret_swadgeland_9.png
Binary file added assets/lumbers/water_floor0.png
Binary file added assets/lumbers/water_floor1.png
Binary file added assets/lumbers/water_floor2.png
Binary file added assets/lumbers/water_floor3.png
Binary file added assets/lumbers/water_floor4.png
Binary file added assets/lumbers/water_floor_b1.png
Binary file added assets/lumbers/water_floor_b2.png
Binary file added assets/lumbers/water_floor_b3.png
Binary file added assets/lumbers/water_floor_b4.png
2 changes: 2 additions & 0 deletions emulator/src/extensions/modes/ext_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "jukebox.h"
#include "mainMenu.h"
#include "pong.h"
#include "lumberjack.h"
#include "touchTest.h"
#include "tunernome.h"

Expand Down Expand Up @@ -58,6 +59,7 @@ static swadgeMode_t* allSwadgeModes[] = {
&jukeboxMode,
&mainMenuMode,
&pongMode,
&lumberjackMode,
&touchTestMode,
&tunernomeMode,
};
Expand Down
2 changes: 1 addition & 1 deletion emulator/src/idf/esp_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ void esp_log_write(esp_log_level_t level, const char* tag, const char* format, .
vsnprintf(dbgStr, sizeof(dbgStr), format, args);
va_end(args);

printf("%c| %s\n", levelChars[level], dbgStr);
printf("%c|%s| %s\n", levelChars[level], tag, dbgStr);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the good stuff I wanted to get into main

}
}
5 changes: 5 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ idf_component_register(SRCS "swadge2024.c"
"modes/dance/dance.c"
"modes/dance/portableDance.c"
"modes/demo/demoMode.c"
"modes/lumberjack/lumberjack.c"
"modes/lumberjack/lumberjackGame.c"
"modes/lumberjack/lumberjackEntity.c"
"modes/lumberjack/lumberjackPlayer.c"
"modes/jukebox/jukebox.c"
"modes/mainMenu/mainMenu.c"
"modes/pong/pong.c"
Expand Down Expand Up @@ -65,6 +69,7 @@ idf_component_register(SRCS "swadge2024.c"
"./modes/pong"
"./modes/tunernome"
"./modes/mainMenu"
"./modes/lumberjack"
"./modes/demo"
"./modes/quickSettings")

Expand Down
347 changes: 347 additions & 0 deletions main/modes/lumberjack/lumberjack.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
//==============================================================================
// Includes
//==============================================================================

#include <stdlib.h>
#include <esp_log.h>

#include "menu.h"

// For lumberjack
#include "lumberjack.h"
#include "lumberjackGame.h"

static void lumberjackEnterMode(void);
static void lumberjackExitMode(void);
static void lumberjackMainLoop(int64_t elapsedUs);
static void lumberjackMenuLoop(int64_t elapsedUs);
static void lumberjackAudioCallback(uint16_t* samples, uint32_t sampleCnt);
static void lumberjackBackgroundDrawCallback(int16_t x, int16_t y, int16_t w, int16_t h, int16_t up, int16_t upNum);
static void lumberjackEspNowRecvCb(const esp_now_recv_info_t* esp_now_info, const uint8_t* data, uint8_t len,
int8_t rssi);
static void lumberjackEspNowSendCb(const uint8_t* mac_addr, esp_now_send_status_t status);

static void lumberjackConCb(p2pInfo* p2p, connectionEvt_t evt);
static void lumberjackMsgRxCb(p2pInfo* p2p, const uint8_t* payload, uint8_t len);
static void lumberjackMsgTxCbFn(p2pInfo* p2p, messageStatus_t status, const uint8_t* data, uint8_t len);

static void lumberjackMenuCb(const char*, bool selected, uint32_t settingVal);

static void lumberjackJoinGame(void);

static const char lumberjackName[] = "Lumberjack";
static const char lumberjackPanic[] = "Panic";
static const char lumberjackAttack[] = "Attack";
static const char lumberjackBack[] = "Back";

// static const char lumberjackNone[] = "None";
static const char lumberjackRedCharacter[] = "Character: Red";
static const char lumberjackGreen[] = "Character: Green";
static const char lumberjackSpecialCharacter[] = "Character: Special";

static const char lumberjackMenuSinglePlayer[] = "Single Player";
static const char lumberjackMenuMultiPlayerHost[] = "Multi-Player";
static const char lumberjackMenuMultiPlayerClient[] = "Multi-Player Join";

const char* LUM_TAG = "LUM";

swadgeMode_t lumberjackMode = {
.modeName = lumberjackName,
.wifiMode = ESP_NOW_IMMEDIATE,
.overrideUsb = false,
.usesAccelerometer = false,
.usesThermometer = false,
.fnEnterMode = lumberjackEnterMode,
.fnExitMode = lumberjackExitMode,
.fnMainLoop = lumberjackMainLoop,
.fnAudioCallback = lumberjackAudioCallback,
.fnBackgroundDrawCallback = lumberjackBackgroundDrawCallback,
.fnEspNowRecvCb = lumberjackEspNowRecvCb,
.fnEspNowSendCb = lumberjackEspNowSendCb,
.fnAdvancedUSB = NULL,
};

lumberjack_t* lumberjack = NULL;

static void lumberjackEnterMode(void)
{
ESP_LOGI(LUM_TAG, "Lumber!");
// Allocate and clear all memory for the menu mode.
lumberjack = calloc(1, sizeof(lumberjack_t));

loadFont("ibm_vga8.font", &lumberjack->ibm, false);
loadFont("logbook.font", &lumberjack->logbook, false);

lumberjack->menu = initMenu(lumberjackName, lumberjackMenuCb);
lumberjack->menuLogbookRenderer = initMenuLogbookRenderer(&lumberjack->logbook);

lumberjack->gameMode = LUMBERJACK_MODE_NONE;
lumberjack->networked = false;
lumberjack->host = false;

lumberjack->menu = startSubMenu(lumberjack->menu, lumberjackPanic);
addSingleItemToMenu(lumberjack->menu, lumberjackMenuSinglePlayer);
addSingleItemToMenu(lumberjack->menu, lumberjackMenuMultiPlayerHost);
addSingleItemToMenu(lumberjack->menu, lumberjackMenuMultiPlayerClient);
lumberjack->menu = endSubMenu(lumberjack->menu);

addSingleItemToMenu(lumberjack->menu, lumberjackAttack);

if (true) // Ignore this line
{
static const char* defaultCharacters[] = {lumberjackRedCharacter, lumberjackGreen};

addMultiItemToMenu(lumberjack->menu, defaultCharacters, ARRAY_SIZE(defaultCharacters), 0);
}
else
{
static const char* defaultCharacterswUnlocks[]
= {lumberjackRedCharacter, lumberjackGreen, lumberjackSpecialCharacter};

addMultiItemToMenu(lumberjack->menu, defaultCharacterswUnlocks, ARRAY_SIZE(defaultCharacterswUnlocks), 0);
}

lumberjack->screen = LUMBERJACK_MENU;

// Lumberjack. Game 19
// Init menu :(

bzrStop(); // Stop the buzzer?

// High score stuff?
// Unlockables ? Save data?
}

static void lumberjackJoinGame(void)
{
if (lumberjack->gameMode == LUMBERJACK_MODE_PANIC)
{
lumberjack->screen = LUMBERJACK_A;
lumberjackStartGameMode(lumberjack, lumberjack->selected);
return;
}

if (lumberjack->gameMode == LUMBERJACK_MODE_ATTACK)
{
lumberjack->screen = LUMBERJACK_B;
lumberjackStartGameMode(lumberjack, lumberjack->selected);
return;
}

lumberjack->screen = LUMBERJACK_MENU;
}

static void lumberjackExitMode(void)
{
lumberjackExitGameMode();

p2pDeinit(&lumberjack->p2p);
freeFont(&lumberjack->ibm);
freeFont(&lumberjack->logbook);
deinitMenu(lumberjack->menu);
free(lumberjack);
}

static void lumberjackMainLoop(int64_t elapsedUs)
{
switch (lumberjack->screen)
{
case LUMBERJACK_MENU:
{
lumberjackMenuLoop(elapsedUs);
break;
}
case LUMBERJACK_A:
case LUMBERJACK_B:
{
lumberjackGameLoop(elapsedUs);
break;
}
}
}

static void lumberjackMenuLoop(int64_t elapsedUs)
{
buttonEvt_t evt = {0};
while (checkButtonQueueWrapper(&evt))
{
lumberjack->menu = menuButton(lumberjack->menu, evt);
}

drawMenuLogbook(lumberjack->menu, lumberjack->menuLogbookRenderer, elapsedUs);
}

static void lumberjackAudioCallback(uint16_t* samples, uint32_t sampleCnt)
{
}

static void lumberjackBackgroundDrawCallback(int16_t x, int16_t y, int16_t w, int16_t h, int16_t up, int16_t upNum)
{
fillDisplayArea(x, y, x + w, y + h, c145);

// Are we drawing the game here?
}

//==============================================================================
// ESP_NOW
//==============================================================================
static void lumberjackEspNowRecvCb(const esp_now_recv_info_t* esp_now_info, const uint8_t* data, uint8_t len,
int8_t rssi)
{
// ESP_LOGI(LUM_TAG, "Getting: %d", (uint8_t)&data);
p2pRecvCb(&lumberjack->p2p, esp_now_info->src_addr, data, len, rssi);
}

static void lumberjackEspNowSendCb(const uint8_t* mac_addr, esp_now_send_status_t status)
{
p2pSendCb(&lumberjack->p2p, mac_addr, status);
}

static void lumberjackConCb(p2pInfo* p2p, connectionEvt_t evt)
{
// Do anything
if (evt == CON_ESTABLISHED)
{
ESP_LOGI(LUM_TAG, "LumberJack.Net ready! %d", (int)p2pGetPlayOrder(p2p));

if (GOING_FIRST == p2pGetPlayOrder(p2p))
{
ESP_LOGI(LUM_TAG, "HOST?");
const uint8_t testMsg[] = {0x01, 0x02, 0x03, 0x04};

p2pSendMsg(&lumberjack->p2p, testMsg, ARRAY_SIZE(testMsg), lumberjackMsgTxCbFn);
}
}

if (evt == CON_LOST)
{
// Do we attempt to get it back?
ESP_LOGW(LUM_TAG, "We lost connection!");
}

lumberjack->conStatus = evt;
}

static void lumberjackMsgRxCb(p2pInfo* p2p, const uint8_t* payload, uint8_t len)
{
// Do anything

if (len > 1)
{
if (payload[0] == 0x19)
{
int locX = (int)payload[1] << 0 | (uint32_t)payload[2] << 8;
int locY = (int)payload[3] << 0 | (uint32_t)payload[4] << 8;
uint8_t frame = (uint8_t)payload[5];
printf("Got %d,%d %d|", locX, locY, frame);

lumberjackUpdateRemote(locX, locY, frame);
}
}

printf("Received %d %d!\n", *payload, len);
}

void lumberjackSendAttack(int number)
{
const uint8_t testMsg[] = {0x13};
p2pSendMsg(&lumberjack->p2p, testMsg, ARRAY_SIZE(testMsg), lumberjackMsgTxCbFn);
}

void lumberjackUpdateLocation(int ghostX, int ghostY, int frame)
{
const uint8_t locationMessage[6]
= {0x19, (uint8_t)(ghostX >> 0), (uint8_t)(ghostX >> 8), (uint8_t)(ghostY >> 0), (uint8_t)(ghostY >> 8), frame};
p2pSendMsg(&lumberjack->p2p, locationMessage, ARRAY_SIZE(locationMessage), lumberjackMsgTxCbFn);
}

/**
* @brief TODO use this somewhere
*
* @param p2p
* @param status
* @param data
* @param len
*/
static void lumberjackMsgTxCbFn(p2pInfo* p2p, messageStatus_t status, const uint8_t* data, uint8_t len)
{
}

static void lumberjackMenuCb(const char* label, bool selected, uint32_t settingVal)
{
ESP_LOGI(LUM_TAG, "Info ");
if (selected)
{
if (label == lumberjackPanic)
{
ESP_LOGI(LUM_TAG, "Panic");
lumberjack->gameMode = LUMBERJACK_MODE_PANIC;
// lumberjack->screen = LUMBERJACK_A;
// lumberjackStartGameMode(LUMBERJACK_MODE_PANIC, lumberjack->selected);
}
else if (label == lumberjackAttack)
{
ESP_LOGI(LUM_TAG, "Attack");
lumberjack->gameMode = LUMBERJACK_MODE_ATTACK;

// lumberjack->screen = LUMBERJACK_B;
// lumberjackStartGameMode(LUMBERJACK_MODE_ATTACK, lumberjack->selected);
}

if (label == lumberjackMenuMultiPlayerHost)
{
p2pInitialize(&lumberjack->p2p, 0x13, lumberjackConCb, lumberjackMsgRxCb, -70);
p2pStartConnection(&lumberjack->p2p);
lumberjack->networked = true;
lumberjack->host = true;
lumberjackJoinGame();
}
else if (label == lumberjackMenuMultiPlayerClient)
{
p2pInitialize(&lumberjack->p2p, 0x13, lumberjackConCb, lumberjackMsgRxCb, -70);
p2pStartConnection(&lumberjack->p2p);
lumberjack->networked = true;
lumberjack->host = false;
lumberjackJoinGame();
}
else if (label == lumberjackMenuSinglePlayer)
{
lumberjack->networked = false;
lumberjack->host = false;
lumberjackJoinGame();
}

if (label == lumberjackRedCharacter)
{
lumberjack->selected = 0;
}
else if (label == lumberjackGreen)
{
lumberjack->selected = 1;
}
else if (label == lumberjackSpecialCharacter)
{
lumberjack->selected = 2;
}

if (label == lumberjackBack)
{
//.switchToSwadgeMode(&mainMenuMode);
}
}
else
{
if (label == lumberjackRedCharacter)
{
lumberjack->selected = 0;
}
else if (label == lumberjackGreen)
{
lumberjack->selected = 1;
}
else if (label == lumberjackSpecialCharacter)
{
lumberjack->selected = 2;
}
}
}
Loading