• Projects
  • Zeptris - a Tetris-inspired game, with physics

https://play.google.com/store/apps/details?id=net.wynoo.zeptris

This my first game made with Godot (3.2)

As in its Russian big brother, there are blocks of different shapes falling down, but here you have a realistic physics, so blocks bump into each other and rotate and move according to their mass and the forces involved.

This creates a totally new gameplay, where you need to worry about weights, balance and all the forces involved. You can even move already landed blocks if you apply enough force.

In addition to the classic game mode where you have to complete lines of 10 (or more), you can unlock two more game modes: - one where you have to pack blocks to fill at least the 80% of the area up to the highest block, - and one where you simply have to load weight without losing blocks.

In all game modes, only blocks that are placed in a stable, straight and orthogonal position can score points.

You can check it out on the Play Store at the link above.

Any feedback is welcome.

Hi! You can share the code for rotate the pieces? I trying to make a spinning background ( in 90 degrees), but I sido not make implement the lerp (and stop) rotation.

6 days later

the idea is increasing or descreasing a target_rotation variabile by PI/2, then setting the angular_velocity with a positive or negative constant to reach the target_rotation with the shortest path; when the actual rotation is near enough to the target one, stop the rotation and fix the sprite rotation to the target

something like this, inside _integrate_forces:

		if _tapped:
			#start rotation
			var tap_x := get_global_mouse_position().x - get_viewport().get_size_override().x/2
			if tap_x > 0:
				_target_rotation += PI/2
				if _target_rotation > PI:
					_target_rotation -= 2*PI
			else:
				_target_rotation -= PI/2
				if _target_rotation < -PI:
					_target_rotation += 2*PI
			
		var delta_rot = angle_difference(_target_rotation, rotation)
		if delta_rot > MAX_ROTATION_ADJUST:
			s.angular_velocity = ROTATION_SPEED
		elif delta_rot < -MAX_ROTATION_ADJUST:
			s.angular_velocity = -ROTATION_SPEED
		else:
			s.angular_velocity = 0
			if delta_rot:
				var xform := s.get_transform()
				xform = Transform2D(_target_rotation, xform.origin)
				s.set_transform(xform)