#first time using godot
26 messages · Page 1 of 1 (latest)
real proud of my self for this one
func spawn_platform():
var platform = test_platform_scene.instantiate()
var platform_spawn_location = Vector2(
randi_range(-16,x_maximum),
Player.position.y + randi_range(y_minimum, y_minimum+320))
platform.position = platform_spawn_location
add_child(platform)
platform.exit_camera.connect(self.on_exiting_camera_view)
it spawns the platform bellow the player that the player can get to it
the camera follows the player but ill delete that, its a debug feature xD
Looks pretty cool!
tnx man working on the assets now
not sure how to make a hamster ball soo the curse smiley xD
Ooh! Is that Aseprite?
kekw
better not exclaim it from the rooftops 🤭
no where in the rules i cant say
yeah true
who of us is without sin lol
looks noice
Also if u wanna give it hamster ball effect I feel like u could just make the ball be the controlled-by-the-player thingy and give the lil' guy inside it a separate sprite, then give him some physics.
I am, however, stupid and have zero experience with the engine besides some doc reading and whatnot.
i tried rigid body
worse 2 hrs of my life
Kekw fair enough
heres the code
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -300.0
@export var rotation_speed = 7
var was_on_floor = true
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
func _physics_process(delta):
if not is_on_floor():
velocity.y += gravity * delta
if Input.is_action_just_pressed("up") and was_on_floor:
velocity.y = JUMP_VELOCITY
was_on_floor = false
if is_on_floor():
was_on_floor = true
var direction = Input.get_axis("left", "right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
if direction > 0.5:
rotation += rotation_speed * delta
elif direction < -0.5:
rotation -= rotation_speed * delta
move_and_slide()```
YEAH BABY
wohooo i finaly have this working
used this to do it
@onready var platform_scene_array: Array = [
preload("res://scene's/Platform_1.tscn"),
preload("res://scene's/Platform_2.tscn"),
preload("res://scene's/Platform_3.tscn")]
func spawn_platform():
var platform = platform_scene_array[randi_range(0, platform_scene_array.size() -1)].instantiate()
platform_spawn_location_func()
platform.position = platform_spawn_location
add_child(platform)
func platform_spawn_location_func():
platform_spawn_location = Vector2(
randi_range(16,x_maximum),
y_minimum)
i now have a lot of stuff