Exploring Playdate Pulp - Boxing Game and other prototypes

Hello everyone, I hope you are well. I'm new here, discovered Playdate about a week ago and here I am, I've fallen down the rabbit hole. :sweat_smile:

I'm a designer/illustrator and I develop websites in Webflow, I'm not a programmer but I have good knowledge of Javascript. In my free time I like to illustrate some ideas for games and Pulp was a great fit for exploring some creative concepts.

I'm currently working on some prototypes with the aim of innovating games made in Pulp. One of them is an pulp Boxing Game :boxing_glove:

boxe

The player tile is where the head tile is, with two side tiles being the left and right arms.

The player is defenseless for a set amount of time, this will be shown subtly in the animation in a frame with the torso and head more advanced. If an opponent spends many frames without defense he is considered weak, if he spends a few frames without defense he is better or stronger. This way I intend to work on the difficulty.

If a punch is applied at the moment when the tile of one of the arms is aligned with the opponent's center and the opponent is undefended, a point is calculated and the blow is shown in conjunction with the animation of the large glove. If you hit the defense, the animation is smaller, as if it were a jab.

My plan is to continue exploring Pulp for a while and try to launch a game before venturing into developing on Lua. :raised_hands:

1 Like

Maybe a platformer, still evolving in terms of appearance...

plataformer

5 Likes

Evolving with the prototype, I am working and refining some points:

  • Player movement and frame animation
  • Adding left and right arms + frame animation
  • Showing the BIG GLOVE when buttons A or B are pressed.

I'm trying some alternatives to change "leftArm" to "leftArmAttack" at the time of the attack. Swap is not working and I believe it has to do with Draw. I noticed that "leftArmAttack" is shown in the correct position but it seems to conflict with "leftArm". The same happens for the right arm.

Please, if anyone has any suggestions to get around this it would be greatly appreciated. (see player code)

Apart from this issue I'm happy with the result and having fun in the process.
b931c21b-dbfd-49e7-9407-ed4a8ce0a41a

on load do
	call "calculateMove"
end

// This function runs every time the player attemps a move
on update do
	call "calculateMove"
end

on calculateMove do
	leftArmX = event.px // event.px is where the player moved
	leftArmY = event.py
	leftArmY -= 1 // the left arm is one tile above
	rightArmX = event.px // event.px is where the player moved
	rightArmY = event.py
	rightArmY += 1 // the right arm is one tile below
end

on draw do
	
	// the "player" (the head) gets drawn automatically;
	// here, we manually draw the tiles called "leftArm" and "rightArm"
	draw "leftArm" at leftArmX,leftArmY
	draw "rightArm" at rightArmX,rightArmY
	
end

on cancel do
	leftAttackX = event.x
	leftAttackY = event.y
	leftAttackX += 1
	leftAttackY -= 1
	
	// change the left arm tile to be extended arm
	tell leftArmX,leftArmY to
		swap "leftArmAttack"
		wait 0.3 then
			swap "white"
			listen
		end
	end
	
	// show right attack in front of player
	tell leftAttackX,leftAttackY to
		swap "leftAttack"
		wait 0.3 then
			swap "white"
			listen
		end
	end
	
end

on confirm do
	rightAttackX = event.x
	rightAttackY = event.y
	rightAttackX += 1
	rightAttackY -= -1
	
	// change right arm tile to be extended arm
	tell rightArmX,rightArmY to
		swap "rightArmAttack"
		wait 0.3 then
			swap "white"
			listen
		end
	end
	
	// show right attack in front of player
	tell rightAttackX,rightAttackY to
		swap "rightAttack"
		wait 0.3 then
			swap "white"
			listen
		end
	end
	
end

Welcome, Carlos! Like you, I'm a web product designer who knows just enough code to be dangerous and started using Pulp recently. This forum has been tremendously helpful!

I'd guess you're running into trouble because Draw is called on every frame, so it's overriding the attack animation since they occur in the same frame. Try swapping the arms during the calculateMove event instead, like so:

	tell leftArmX,leftArmY to
		swap "leftArm"
1 Like

Hi @andonks , thanks for the idea! I will explore this path that you indicated. I believe that's right, the issue is related to Draw, which is overwriting the attack animation on the arm when the player needs it.

I will post the result and the code here when I manage to solve it.
Thanks.

1 Like