I made this small game similar to flappy birds, where one can use to fly up and down using the mouse and keyboard.
I won't be posting the full code because it's a university project and I don't want to get caught for any possible plagiarism.
What I did was, I used two objects:
A rectangle as the bird:
r= rectangle('Position', pos, 'curvature', [0.99,0.1], 'FaceColor', 'r', 'EraseMode','xor');
Thick lines to represent the walls:
line([ 100 100], [10 400], 'color', 'm', 'LineWidth', 10, 'EraseMode', 'background')
My problem:
The problem is that the bird moves through the walls, as if the walls were transparent. As you can imagine, I want to break the game and show something like "game over", when the bird hits the wall (not go through them). How do I make it such that my game breaks when the bird (object 1) collides with the walls (other objects)?
Thank You Very Much for reading my question!