Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Sry, habe wohl x und y bei der Plattform vertauscht. Arg und nach dem dummen Fehler such ich dann die ganze Zeit -.-
//Closed
Hey,
ich wollte heute etwas mit Box2D rumprobieren um die Engine besser kennenzulernen.
Naja aber jetzt habe ich schon bei dem ersten kleinen Programm Probleme und ich kann den Fehler einfach nicht finde. Gut, ich bin jetzt noch recht neu in Box2D, aber ich habe mir mittels der Anleitung mein Programm mehrmal durchgeschaut und finde den Fehler leider trotzdem nicht. Auch Google spuckt zu dem Thema nicht gerade viel aus.
Hier mal eine kleine Beschreibung zu meinem Problem:
Also ich hab eine Plattform und eine Box (im Code wird die Box als Ball bezeichnet), die Plattform ist ein statisches Objekt und die Box ein Dynamisches. Ich positioniere die Box über der Plattform, damit die Box dann auf diese fallen kann.
Das erste Problem ist jetzt schon, dass die Box ohne lineare Geschwindigkeit gar nicht fällt, obwohl ich eine Schwerkraft mit (0.0f , 9.8f) gesetzt habe.
Das zweite Problem ist, dass wenn ich eine lineare Geschwindigkeit gesetzt habe, die Box immer nur bis zu y = 175 Pixel fällt und dann einfach stoppt. Das Komische ist, dass wenn ich die Box auf eine Position mit, zum Beispiel, y = 200 setze, dann "fällt" die Box plötzlich nach oben zu den y = 175 Pixel und stoppt dort wieder.
Ich kann mir beim besten Willen nicht vorstellen, wieso die Box immer zu y=175 will.
Ich hoffe, dass einer von euch eine Idee oder sogar eine Lösung hat, denn ich komme einfach nicht mehr weiter.