close
Skip to content

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

@dvmierlo

Description

@dvmierlo

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions