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

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

Open
dvmierlo opened this issue Sep 6, 2022 · 1 comment
Assignees

Comments

@dvmierlo
Copy link

dvmierlo commented Sep 6, 2022

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants