I believe it should be 'setCollideRect' rather than 'setCollisionRect' (0:35) ...and it seems you need to write 'isa' not 'isA' (4:01) I don't mean to be pedantic. I'm just following along and ran into these issues. Loving your videos and looking forward to more. Sprite animation would be great!
Another great video! I've solved "tunneling" in a lot of platformer prototypes but never realized that was the term for it. Also I think an OOP primer for Lua/Playdate would be valuable for a lot of people if you ever feel like making it. 👍🏼
Thanks! I have a lot of ideas for other tutorials to make. It'll be interspersed with devlog style content, but these types of videos will keep coming.
Your videos are awesome. I have not done any code since HS(1998) and I really want to try and make a zelda like game on my playdate and hoping you do a lot more tutorials and guides. They are very clear and easy to understand for someone who hasn't coded in years!!!!!
Thank you for the tutorials! I've watched them all, and they've been very helpful, but this one left me with more questions than answers. I'm trying to make a very simple box-bouncing-off-of-wall demo. I cannot get sprites to collide for the life of me. Where are you supposed to write "gfx.sprite:collisionResponse(other) return 'bounce' end"? In the initialize function? In the playdate.update function? At the bottom, after everything? I've tried them all. Didn't work. Isn't 'bounce' just an arbitrary string in the Lua file? How does it know that 'bounce' is a collision behavior? Does putting (other) work on its own, or does "other" need to be a local variable, named elsewhere in the script? I replaced "other" with the name of the sprite with which the sprite must collide. Didn't work. I used moveWithCollision to test if my sprites COULD collide, and it seems they did (they 'froze' touching each other upon initialization), but that doesn't help me do anything active. I've been poring over your code in the arrow example for the past three days, but it's far too complex (for a beginner like me) to be of any instructional value: it involves two Lua scripts, one of which imports into the other, it uses concepts and terminology that your tutorial doesn't explain (I couldn't even find curSpeed in the SDK Documentation, so "self.x + self.dir * self.curSpeed, self.y + self.yOffset" might as well be Chinese). Finally, I checked out some single file examples that come with the SDK, but I didn't find anything relevant to my question. All I need is a tutorial/example of a simple sprite collision. I can build and learn from there, but I need to know how to crawl before I can walk. Do you know of any such tutorial/example? Thanks! P.S.: I'm sorry if this message came across as whiny or self-entitled or critical. I really am very grateful for your tutorials, and they have helped. I've just been extremely frustrated by this one issue, and I haven't found any other guides to collisions besides your own. Checking the forums now!
Hi! No worries - I can see why this would be confusing. My code example is using something called Object Oriented Programming, which is why it looks different and confusing. I made a video on it that might make it clear. If you aren't using OOP, you can do it like this. Let's say you have a sprite called mySprite. You can do mySprite.collisionResponse = function(other) return 'bounce' end. What's happening is that the sprite library calls this collisionResponse function that belongs to the sprite, which by default returns 'freeze', but, what you want to do is overwrite that function with your own. You're correct that these are arbitrary strings, but, the sprite library, when handling collisions, first calls that function on the sprites that are colliding and checks the strings that are returned to figure out what type of collision to do, and it's just set up to expect those specific arbitrary strings. If you have more questions, feel free to hop in my discord to ask. I think it's much easier to answer code related questions there.
Hi! Next video (this coming Monday) will be on Sprites and how to use push context, and my next video after that (following Monday) will be on OOP. I have a video plan for tilesets but that might not be for a bit. Thanks!
HeckBoi! Welcome back - haven't seen you around for a while. Full steam game is probably a lot further down the line, and I would probably make a full Playdate game release first.
I believe it should be 'setCollideRect' rather than 'setCollisionRect' (0:35)
...and it seems you need to write 'isa' not 'isA' (4:01)
I don't mean to be pedantic. I'm just following along and ran into these issues. Loving your videos and looking forward to more. Sprite animation would be great!
Ah good catch! Thanks for pointing these out. Sprite animations are on my list :)
i appreciate you doing these tutorials it makes the coding so much easier to understand from a learning perspective
Thanks - really happy that my videos are helping
Another great video! I've solved "tunneling" in a lot of platformer prototypes but never realized that was the term for it. Also I think an OOP primer for Lua/Playdate would be valuable for a lot of people if you ever feel like making it. 👍🏼
Sounds good - I'll put it somewhere in the video pipeline
Definitely do the OOP next! I am experienced in C# and very familiar with the concepts but would love a fresh Lua tutorial, can't wait to see more!
Fascinating. I'm a total noob but one day want to program a game for the playdate. Your videos are both informative and inspirational. Keep em coming.
Thanks! I'll keep trying to make Playdate development as accessible as possible.
Your channel is going to blow up soon (in a good way) keep making quality videos I love seeing new developers UA-cam channel growing
I won't be slowing down anytime soon - thanks!
@@SquidGodDev yeah this is the best channel by far for anyone who got a playdate looking to learn game dev. I think it's a lot of people.
Awesome. OOP in Lua / the Playdate SDK would be amazing!
Of the different channel options for developing for Playdate, yours is significantly more helpful. Please, please, please keep going.
Thanks! I have a lot of ideas for other tutorials to make. It'll be interspersed with devlog style content, but these types of videos will keep coming.
Your videos are awesome. I have not done any code since HS(1998) and I really want to try and make a zelda like game on my playdate and hoping you do a lot more tutorials and guides. They are very clear and easy to understand for someone who hasn't coded in years!!!!!
Thanks! I will be making a lot more tutorials, so no worries about that.
That alpha collision thing seems really useful for getting better hitboxes! I'ma use that!
once again, the visuals really help. keep 'em coming!
Thanks - I find they're helpful for me on other people's videos so I'll do my best to keep incorporating stuff like that.
DOOOOPPPPPEEEEEE YESSSS MAKE MORE PLAYDATE CONTENT
Great video. Keep 'em up! Thanks!
Congrats on 500
This is Randomness. I forgor my login for my other channel 💀
Thanks - did you actually lol?
@@SquidGodDev yes
Get rekt
Thank you for the tutorials! I've watched them all, and they've been very helpful, but this one left me with more questions than answers. I'm trying to make a very simple box-bouncing-off-of-wall demo. I cannot get sprites to collide for the life of me.
Where are you supposed to write "gfx.sprite:collisionResponse(other) return 'bounce' end"? In the initialize function? In the playdate.update function? At the bottom, after everything? I've tried them all. Didn't work. Isn't 'bounce' just an arbitrary string in the Lua file? How does it know that 'bounce' is a collision behavior? Does putting (other) work on its own, or does "other" need to be a local variable, named elsewhere in the script? I replaced "other" with the name of the sprite with which the sprite must collide. Didn't work.
I used moveWithCollision to test if my sprites COULD collide, and it seems they did (they 'froze' touching each other upon initialization), but that doesn't help me do anything active.
I've been poring over your code in the arrow example for the past three days, but it's far too complex (for a beginner like me) to be of any instructional value: it involves two Lua scripts, one of which imports into the other, it uses concepts and terminology that your tutorial doesn't explain (I couldn't even find curSpeed in the SDK Documentation, so "self.x + self.dir * self.curSpeed, self.y + self.yOffset" might as well be Chinese). Finally, I checked out some single file examples that come with the SDK, but I didn't find anything relevant to my question.
All I need is a tutorial/example of a simple sprite collision. I can build and learn from there, but I need to know how to crawl before I can walk. Do you know of any such tutorial/example?
Thanks!
P.S.: I'm sorry if this message came across as whiny or self-entitled or critical. I really am very grateful for your tutorials, and they have helped. I've just been extremely frustrated by this one issue, and I haven't found any other guides to collisions besides your own. Checking the forums now!
Hi! No worries - I can see why this would be confusing. My code example is using something called Object Oriented Programming, which is why it looks different and confusing. I made a video on it that might make it clear. If you aren't using OOP, you can do it like this. Let's say you have a sprite called mySprite. You can do mySprite.collisionResponse = function(other) return 'bounce' end. What's happening is that the sprite library calls this collisionResponse function that belongs to the sprite, which by default returns 'freeze', but, what you want to do is overwrite that function with your own. You're correct that these are arbitrary strings, but, the sprite library, when handling collisions, first calls that function on the sprites that are colliding and checks the strings that are returned to figure out what type of collision to do, and it's just set up to expect those specific arbitrary strings. If you have more questions, feel free to hop in my discord to ask. I think it's much easier to answer code related questions there.
I just made a Group 1 for enemies and the collisionResponse method didnt recognize isa(Enemy), but i works when i remove the group
Great tutorial! Can you tell us how the debugging pink rectangles are shown?
Yeah for sure! All you have to do is go to the top of the Playdate simulator, click view, and check "Show Sprite Collisions".
Oh I'm blind lol. Thanks for the tip!
I'm trying to make a simple pinball game. This is extremely helpful!!!
Glad I could help out!
great video thank you !!!!
Np
Thank's a lot: really (really) helpfull.
Awesome! Glad to hear.
Yes pls make OOP next, and then how to implement tilesets ❤
Hi! Next video (this coming Monday) will be on Sprites and how to use push context, and my next video after that (following Monday) will be on OOP. I have a video plan for tilesets but that might not be for a bit. Thanks!
when dud you get 500 subs, will u make a full game that you COULD publish on steam
HeckBoi! Welcome back - haven't seen you around for a while. Full steam game is probably a lot further down the line, and I would probably make a full Playdate game release first.
If anybody has SDK 1.7.o on their computer, please reply if you can help me to obtain a copy.