Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  2d Platformer collision  (Read 709 times)
0 Members and 2 Guests are viewing this topic.
Offline jammas615

Jr. Member
**

Posts: 70



« on: 2012-02-04 16:03:36 »

Hey,
I've been thinking of ideas and can't seem to get many solid methods of collision detection.

I have a platformer/tower climber, i want the player to be able to jump up through the bottom of the platforms but not down. I can get that working fine, but its when i want the player to be able to jump back off the platform i'm stumped for ideas.

Does anyone have any good ideas?

Thanks.

Offline ra4king

JGO Kernel
*****

Posts: 3131
Medals: 195


I'm the King!


« Reply #1 on: 2012-02-04 22:08:53 »

What exactly are you stumped with? You just said you were able to implement jumping.

Offline jammas615

Jr. Member
**

Posts: 70



« Reply #2 on: 2012-02-04 22:36:58 »

It was a bad question because the answer was staring me in the face. But now im thinking of ways of vertical scrolling. Which would just be a camera position to offset everything to wouldn't it?

Games published by our own members! Go get 'em!
Offline UprightPath

Full Member
**

Posts: 211
Medals: 9



« Reply #3 on: 2012-02-04 22:44:11 »

Yay, and I fail at reading follow up posts, don't I? Cheesy

Ahem, as for vertical scrolling in two dimensions? It could be 'camera' position, or at least view position if you're thinking about regular styled scrolling.

I am filled with despair... About how far people think about ideas they propose, about the state of my teams in classes when people do not understand what an assumption is...
Offline ra4king

JGO Kernel
*****

Posts: 3131
Medals: 195


I'm the King!


« Reply #4 on: 2012-02-04 23:03:43 »

Yep, a yOffset variable is all you need, which you either call translate(0,yOffset) or add it to all entities Smiley

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.078 seconds with 19 queries.