Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Best collision pixel perfect system EVER, without physics (T_T) on: 2013-03-30 22:55:02
http://www.java-gaming.org/topics/making-a-sprite-jump/28350/msg/257412/view.html
definitely check that out! I asked a similar question about jumping / gravity
Thanx! When I'm done, I'll share source code.
2  Game Development / Game Mechanics / Re: Best collision pixel perfect system EVER, without physics (T_T) on: 2013-03-30 22:37:01
Okay.jpg
I apologize for the stupid question.
3  Game Development / Game Mechanics / Re: Best collision pixel perfect system EVER, without physics (T_T) on: 2013-03-30 20:51:59
Sorry, that is not expressed. I need a pseudocode of jump & gravity.
4  Game Development / Game Mechanics / Re: Best collision pixel perfect system EVER, without physics (T_T) on: 2013-03-29 17:20:12
Oh, sorry...


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
// CHECK
collides(Level level) {
   boolean result = false;
      // TOP
      if (is_tile_solid(x+1, y, level)) result = true;
      if (is_tile_solid(x+w-2, y, level)) result = true;
      // BOTTOM
      if (is_tile_solid(x+1, y+h-1, level)) result = true;
      if (is_tile_solid(x+w-2, y+h-1, level)) result = true;
      // LEFT
      if (is_tile_solid(x, y+1, level)) result = true;
      if (is_tile_solid(x, y+h-2, level)) result = true;
      // RIGHT
      if (is_tile_solid(x+w-1, y+1, level)) result = true;
      if (is_tile_solid(x+w-1, y+h-2, level)) result = true;
   return result;
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
// MOVE ENTITY
void move(Level level, int delta) {
   float axs = Math.abs(xs);
   float ays = Math.abs(ys);
   float max = ays;
   if (axs > ays) { max = axs; }
   float xstep = xs/max;
   float ystep = ys/max;
   float axstep = Math.abs(xstep);
   float aystep = Math.abs(ystep);
   while (axs > 0 || ays > 0) {
      x += xstep;
      if (collides(level)) { x -= xstep; }
      y += ystep;
      if (collides(level)) { y -= ystep; }
      axs -= axstep;
      ays -= aystep;
   }
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
// COLLISION
boolean is_tile_solid(float xpos, float ypos, Level level) {
   int i = (int) ((xpos) / Level.tilesize);
   int j = (int) ((ypos) / Level.tilesize);
   if (i >= 0 && i < level.getMapWidth() && j >= 0 && j < level.getMapHeight()) {
      if ( level.getMap().getTileId(i, j, Cnst.COLLISION) == Cnst.SOLID ) return true;
      else return false;
   }
   return true;
}
5  Game Development / Game Mechanics / Re: Resolving Pixel Perfect Collisions on: 2013-03-29 17:16:46
Check this.
http://www.java-gaming.org/topics/best-collision-pixel-perfect-system-ever-without-physics-t-t/29140/view.html
6  Game Development / Game Mechanics / Best collision pixel perfect system EVER, without physics (T_T) on: 2013-03-29 17:15:11
Sup, community, I'm newbie. I'm creating a game with elements of classic platformer (Mario, etc...) on Slick2D. I made a pixel perfect, quick and simple system collision, I think. You can download and try for yourself. But I have some problems with physics (jump, gravity, acceleration). I learned a lot of stuff, soo... and I have no idea how it works. Please, help! T__T
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (34 views)
2014-10-27 03:28:38

TehJavaDev (27 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (59 views)
2014-10-16 15:22:06

Norakomi (48 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!