#2d game

1 messages · Page 1 of 1 (latest)

worn trout
#

Am making a simple 2d game that basically jumps and avoid obstacles

Help Needed:
Guidance on setting up the player (CharacterBody2D) with touch controls for Android.
Tips for creating procedural or hand-crafted platform layouts.
Best practices for a settings menu and HUD in Godot 4.
Any optimization advice for Android (e.g., performance on mid-range devices).

sand crag
#

I've got a flappybird style controller, here's what I did:

`extends CharacterBody2D

var gravity : float = 10.0
var jump_strength : float = 5500

func _process(delta: float) -> void:

velocity.y += gravity * delta

if Input.is_action_just_pressed("Jump"):
    current_gravity_strength = 0
    velocity.y = -jump_strength * delta

move_and_slide()`

If you want it to be more lke the Dino game, go:

if Input.is_action_just_pressed("Jump") and is_on_floor():