Pi4J / pi4j-example-fxgl

Apache License 2.0
4 stars 0 forks source link

Missing details in Getting started with Pi4J - Game development with FXGL #15

Open dvmierlo opened 2 years ago

dvmierlo commented 2 years ago

Hi,

I have followed the instructions on Getting started with Pi4J - Game development with FXGL. I do not get past the chapter "Picade".

Can you please explain my questions below?

Thank you in advance for your support.

Update Game:

You mention:

Change your Game from “extend GameApplication” to “extend PicadeGameApplication” PicadeGameApplication overrides the GameApplication class of FXGL and provides additional functions to map the picade controller

public class FxglExample extends PicadeGameApplication

Where is the class PicadeGameApplication located?

Update Key Inputs

You mention:

Now we can use the new piMapper to address keys as well as picade controls. To do this, we need to tell the onKeyDown function, what control we want. Inputs are defined as in previous tutorials in the picadeControl enum

onKeyDown(PicadeControl.PIN_BUTTON_1, KeyCode.F, () -> player.getComponent(SnakeHeadComponent.class).grow());
onKeyDown(KeyCode.G, () -> player.getComponent(SnakeHeadComponent.class).log());

Where is the enum picadeControl located?

GIPO

You mention

The Enum PicadeControl handles the the gpio numbers for the connected controls. pinout.xyz

PIN_JOYSTICK_UP(12),
PIN_JOYSTICK_DOWN(6),
PIN_JOYSTICK_LEFT(20),
PIN_JOYSTICK_RIGHT(16),
PIN_BUTTON_1(5);

This step is unclear what to do here.

FDelporte commented 2 years ago

Good remarks and I can't answer immediately... let's check if @DieterHolz can help us here...