Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 22:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Java Collision mit mehreren Rects

Discussion on Java Collision mit mehreren Rects within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
bashdard's Avatar
 
elite*gold: 1
Join Date: Apr 2012
Posts: 376
Received Thanks: 55
Java Collision mit mehreren Rects

Hey,
ich lerne im moment Java, und bin dabei ein kleines Spiel zu programmieren.
Es geht um ein Puzzle, bei welchem man ein kleines Viereck steuert, welches so lange weiter rutscht bis es an eine wand stößt. Die Collision Detection mit 1nem objekt klappt auch wunderbar, da ich das objekt in die überprüfung gesetzt habe, ungefähr so:
Code:
WAND = new Rectangle(WAND.x, WAND.y, WAND.width, WAND.height);
WAND2 = new Rectangle(WAND2.x, WAND2.y, WAND2.width, WAND2.height);
player = new Rectangle(player.x,player.y,player.width,player.height);
		
rect = WAND;
if (player.intersects(rect)){
	stopMovement();
	setOffWall(rect);
}
Diese collision überprüft aber leider nur das Rectangle "WAND" und nicht "WAND2".
Die wände sind alles einzelne Rectangles mit namen.



Hat jem. eine Idee, wie das funktionieren kann?
bashdard is offline  
Old 09/18/2012, 20:13   #2
 
D3adlySil3nc3's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 288
Received Thanks: 40
Zeig mal deine Game-Loop.
Dann kann man leichter helfen....
D3adlySil3nc3 is offline  
Reply


Similar Threads Similar Threads
SRO - Collision System ?
07/26/2012 - SRO Coding Corner - 6 Replies
Hi, I have a silkroad server project. The only problem with the player collision system objects. Do you help me? This code is in the hands of the Arcane project and made ​​this system here? Programming language: C # VIDEO: http://www.youtube.com/watch?v=5dlSGFXsjV8
CRC Collision vs Bypass
09/03/2011 - Mabinogi - 6 Replies
Whats the deal with all these bypasses? CRC is not a cryptographic hash like SHA512 or MD5 (broken), it's a checksum and can be broken with a pencil and paper if you understand the algorithm, or brute forced (it's not strong)-- as it's not intensive or very hard to brute force by adding padding. Think about it, do you want to dig around in olly and iderpro all day or just add some garbage to the end of the file? Edit: vulnerable much?
Navmesh X, Y Collision
08/03/2011 - SRO Coding Corner - 21 Replies
Soo lately I've been working on the navmesh files and I used drew's edxNVMViewer for this. But I've got a little stuck right now. For my project I'm using the nvm.h and nvm.cpp to load the navmesh file and I'm saving it in my memory. Everything goes fine and I get the correct Z position from the navmesh but I can't figure out how to get the forbidden area's in the navmesh. Like when a character walks up a mountain it will stop at some points since there is a collision. How am I able to...
Cave collision?
06/05/2011 - SRO Coding Corner - 1 Replies
a while ago i created a thread about the navmesh for the normal map but right now i am having some problems finding the cave collision. is this one also in one of the .nvm files? or is it one of those ainavdata cause the name sounds more like some navigation data for the mobs. is the info about this stuff publicly available or does it need to be reversed?



All times are GMT +1. The time now is 22:59.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.