1 Attachment(s)
Hard to explain, see topic (Sorry)
Attachment 4399
I want to make it so when the bike touches the block, game over. I can handle the game over part, but I don't know how to handle the two JLabels touching. Any ideas? Thanks
BTW, the block scrolls across the screen, and the bike can jump
Re: Hard to explain, see topic (Sorry)
Your program should have a logic portion and a GUI portion, and possibly a control portion that connects the two. The code that checks for collisions should be in the logic portion and should have no GUI code in it at all. A simple if block would be adequate for testing for collision, perhaps with a for loop if you're testing for collision of multiple entities.
Re: Hard to explain, see topic (Sorry)
Quote:
Originally Posted by
Fubarable
Your program should have a logic portion and a GUI portion, and possibly a control portion that connects the two. The code that checks for collisions should be in the logic portion and should have no GUI code in it at all. A simple if block would be adequate for testing for collision, perhaps with a for loop if you're testing for collision of multiple entities.
I don't know how to check for collision
Re: Hard to explain, see topic (Sorry)
Nevermind, got it. Thanks for the help