Android game character forward and backward movements

I am very new to Castle Game Engine … just today I successfully installed CGE and Free Pascal fps game got working successfully. On android how to move forward and backward … on window of course for the long time there has been awsd keys …

1 Like
  1. You can just drag your finger on the screen, and by default the TCastleWalkNavigation should react by allowing you to walk forward / backward.

  2. To get better navigation on mobile you can use TCastleTouchNavigation class, Castle Game Engine: CastleViewport: Class TCastleTouchNavigation . It will display 1 or 2 circles at the bottom-left / bottom-right corners that allow to move / rotate. It has various modes of operating.

    The examples examples/mobile/simple_3d_demo/ and examples/viewport_and_scenes/occlusion_culling/ should show it.

    And yes, we should have more examples using it :slight_smile: In particular examples/fps_game/. Navigation in that demo will be upgraded soon anyway, after merging this PR: New physics based first/third person 3d and platformer like modular navigation + input axis and others by and3md · Pull Request #533 · castle-engine/castle-engine · GitHub .

  3. Finally, you can also code it yourself for particular game, if above “ready” solutions are not enough. From code, you can just observe mouse events (e.g. by overriding view methods, Designing user interface and handling events (press, update) within the view | Manual | Castle Game Engine ; in this case, Motion would be the interesting method to override to watch for mouse/touch movement). And then you can modify camera in response, moving or rotating it as you see fit, see Camera | Manual | Castle Game Engine .