Hi there! I'm trying to make a platformer, and I am having some trouble with bitmap collisions. I am relatively new to programming, and have one semester of computer science courses under my belt with a pretty thorough understanding of the basics of C++.
I got the Gamebuino for Christmas and have been looking through the references and codes of various games others have made. I started coding with classes for my first attempt and got some okay results. But after looking at other people's codes, I didn't see any classes, and I started to notice people using multiple .inos files. I did some more research on how those work, and I like it! I'm starting to get it more figured out, with using more global variables and stuff.
Anyways, I'm saying way too much without asking my question. The basic question is, would I be able to make a collision function that detects if a specific bitmap (i.e. the main character sprite) collides with a non-specific bitmap of which there are multiple instances (i.e. a floor tile or an enemy)? And how would I go about doing that?
The collideBitmapBitmap function seems to only take parameters of specific bitmaps, since it needs the x and y coordinates of both. Or maybe I just need to rethink how I initialize the bitmaps?
My "room" is a row of 4x4 tiles on the bottom of the screen. I made an array of their x-coordinates so that I could run through that with a for loop and the bitmap collide function, and that works fine because they all have the same y-coordinate. But as soon as I want to put a tile somewhere else, I obviously have a problem because I can't check that in the collide function. I just thought of a way to maybe do it with a 2D array, but this is getting a little too complicated. Any other ideas?
Sorry this is such a long "question". But I'm glad this community is here, it's pretty neat! Thanks for putting this all together, rodot!