Skip to content

Conversation

wjt
Copy link
Member

@wjt wjt commented Oct 25, 2024

starnight and others added 30 commits October 9, 2024 15:01
Copied from game-01
max_polyphony is set to 10 for ding & pew to allow overlapping sounds since if
you happen to collect two coins in quick succession the previous sound may
still be playing when the next one starts. But we never crash twice so that one
has the default max_polyphony of 1.
Obstacles now move towards the left. No gravity is applied.
The ship collides with the obstacle.
The image doesn't loop properly but we can fix that later.
When obstacles scroll off the left screen, they fall into a new
deadzone where we detect the collision and remove them.
Instead we will use the built-in blocks to load a sound by path and play it by name
wjt and others added 28 commits October 10, 2024 16:28
The BackgroundMusic node should have its Autoplay property set to start the
music when the game starts. I haven't done this because it's so annoying in
development.

We have no blocks for AudioStreamPlayer nodes so we can't call stop on the
track, but we can just remove the player from the scene.
(cherry picked from commit b496173)
This was a runner, like game-06. But it predated SimpleSpawner, so used
animations to make the obstacles fly past. game-06 is a more exemplary example
of the same concept, using newer plugin features.
Port split-screen to current plugin version
To latest Block Coding plugin version. Changes:
- Node blocks are used for calling methods when possible.
- The remaining groups are now global (and thus shared with the other
  demos). These are used for calling the same method in multiple nodes
  or for a single node in a different scene.

The game should play as before. An upcoming change will use the new
SimpleSpawner for the blasters.

https://phabricator.endlessm.com/T35693
Update Space Ship top-down demo
The Block Code plugin has been updated to newer one which is not
backward compatible. So, update the Platformer accordingly.
Use Sprite2D as the frames holder and AnimationPlayer to play idle,
walk_right, walk_left, jump_up and jump_down animations. Also, defined
methods be_idle, walk_right, walk_left, jump_up and jump_down in the
BlockCode of the AnimationPlayer. They can be invoked by the player's
action.
Thanks to the new Block Coding plugin providing access the node's method
feature. This commit uses it to play the AnimationPlayer's shake
animation by invoking the the Block node's play_shake method of the
AnimationPlayer node.
Play the hit animation of the AnimationPlayer node when reset the
player.
Drop AnimatedSprite2D node from player scene. It was the reference of
the new AnimationPlayer node.
Previously the RESET track also wobbled the platform. With this change, the
RESET track restores the platform's position to (0, 0).
If the player does not move, then there is no need to check it is on the
floor, nor velocity of y direction. Use the "else if" condition to avoid
further check which improves performance.
Rebase the platformer demo agaist the new plugin
This was mainly a direct reimplementation of each BlockCode program, with a few
tweaks. I had to make the Ball group global so that it shows up in the
“[something] is in group [group ▼]” dropdown. I also added an extra Reset
method on the "Bump!" label to hide it when the game resets, calling it
directly with "call [method] on [node]".

The code that plays one of 5 sounds at random when the ball hits a pin
previously relied on being able to pass an int as the "sound name" parameter,
which would for some reason I didn't bother digging into would previously cause
a str() conversion to be inserted, but now does not.

```gdscript
func _on_body_entered(body: Node2D):
	if body.is_in_group('Ball'):
		PinSound = randi_range(1, 5)
		var __sound_node_1 = get_node(str(PinSound))
		# ...
```

So instead I use a chain of conditionals that compiles to:

```gdscript
func _on_body_entered(something: Node2D):
	if ((something).is_in_group('Ball')):
		PinSound = randi_range(1, 5)
		if PinSound == 1:
			var __sound_node_1 = get_node('1')
			# ...
		elif PinSound == 2:
			# ...
```

This is a bit wordier than what was there before but it works.

It would be nice to have a way to define a local variable rather than a
property of the node, but it's not the end of the world.

https://phabricator.endlessm.com/T35697

JJ:	 M game-04/main.tscn
JJ:	 M game-04/pin.tscn
JJ:	 M project.godot
Port Pachinko to current plugin version
This backs out commit 3ede4ed.

All other games are now functional again.

https://phabricator.endlessm.com/T35683
@wjt wjt merged commit af353e1 into main Oct 25, 2024
@wjt wjt deleted the godotcon branch October 25, 2024 07:47
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

Successfully merging this pull request may close these issues.

7 participants