KLITZEKLEINES KollisionsProblem
Übersicht

fliegeBetreff: KLITZEKLEINES KollisionsProblem |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
was muss ich tun, dass die Kollision richtig funktioniert? Ich habe ein ISO Spiel, wo die Kollision mit imagescollide abgefragt werden soll.
Ich habe hier aus Platzgründen nur den Code für die untere Pfeilteste geschrieben: Code: [AUSKLAPPEN] If koli = 1 Then draw_player(animation) EndIf If KeyDown(go_down) ;;;nach unten;;; turn = 0 koli = images_kollision() px = px + 1 py = py + 1 scroolx = scroolx + 16 scrooly = scrooly + 12 animation=animation_down animation_down = animation_down + 1 If animation_down>46 Then animation_down=42 EndIf EndIf Function images_kollision() kollision = 1 If turn = 0 Then If ImagesCollide(Spieler, px, py, animation, G, px+1, py+1, 0) Then kollision = 1 If ImagesCollide(Spieler, px, py, animation, W, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, Bu11, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, Bu12, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, Bu21, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, Bu22, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B116, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B117, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B118, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B119, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B120, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B121, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B316, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B317, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B318, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B319, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B320, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B321, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B416, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B417, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B418, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B419, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B420, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B421, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B516, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B517, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B518, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B519, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B520, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B521, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B616, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B617, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B618, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B619, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B620, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B621, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B622, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B623, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B624, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B625, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B626, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B627, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B628, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B629, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B630, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B631, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B632, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B633, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B634, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, B635, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, TB7, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, TB8, px+1, py+1, 0) Then kollision = 0 If ImagesCollide(Spieler, px, py, animation, TB9, px+1, py+1, 0) Then kollision = 0 EndIf End function Doch jetzt wird nicht mehr einmal der Spieler gezeigt, denn aus irgendeinem Grund wird dann die koli zu 0. Bitte helft mir schnell, da ich sonst nicht mehr viel zu tun habe... Fliege |
||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
geht glaub kaum noch komplizierter wa ...
Code: [AUSKLAPPEN] Function images_kollision() kollision = 0 If turn = 0 Then If ImagesCollide(Spieler, px, py, animation, G, px+1, py+1, 0) Then kollision = 1 end if end function |
||
fliege |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
cih weiß nicht, aber es scheint, als würden nun beide Codes nicht mehr funktionieren... | ||
![]() |
KabelbinderSieger des WM-Contest 2006 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Also ich habe aus dem Code nicht entnehmen können, worum es dabei geht. Aber ich denke "kollision = 0" liegt daran, dass du zuerst prüfst, ob der Player an das Bild "G" Stößt und dann überprüfst du, ob das bild an andere Bilder stösst. Warum das?
Ich meine, wenn das Bild des Players an das Bild "G" stößt heist das doch nicht unbedingt, dass kein anderes Bild sonst an das Bild des Players Stoßen darf. Also ich denke, die Variable kollision wird zunächst 1 und dann (weil ein anderes Bild an das des players stößt) 0. |
||
<Wing Avenger Download> ◊◊◊ <Macrophage Download> |
![]() |
Gossi |
![]() Antworten mit Zitat ![]() |
---|---|---|
Meinst du nicht, dass dir hier u.a. auch For-Next-Schleifen hilfreich sind? | ||
Alle Wasser laufen ins Meer, doch wird das Meer nicht voller; an den Ort, dahin sie fließen, fließen sie immer wieder. (...) Was geschehen ist, eben das wird hernach sein. Was man getan hat, eben das tut man hernach wieder, und es geschieht nichts neues unter der Sonne. Geschieht etwas, von dem man sagen könnte: "Sieh, das ist neu"? Es ist längst vorher auch geschehen in den Zeiten, die vor uns gewesen sind. |
fliege |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
könnt ihr da vielleicht auch nur kleine Pseudocodes hereinschreiben? | ||
![]() |
KabelbinderSieger des WM-Contest 2006 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich fürchte, ich kann keinen Pseudocode anbieten, da ich wiegesagt aus dem Quelltext nur wage entnehmen kann, worum es bei dem Spiel geht, und wie es aufgebaut ist. ![]() Aber in meinem Post steht eigentlich auch schon alles drin. |
||
<Wing Avenger Download> ◊◊◊ <Macrophage Download> |
fliege |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Um es ein bisschen näher zu beschreiben:
Es ist ein ISO RPG mit Diamond Mapping... Bu11 und Bu12 sind zum Beispiel die beiden Teile für einen Busch. Ich möchte aber nicht, das der Spieler durch alles auser Sand(S) oder Gras(G) gehen kann, und frage deshalb immer wieder ab, ob diese Images nun Kollidieren oder nicht. Ich kann auch den gesammten Quellcode Uppen, dauert aber und ist sehr sehr schlecht kommentiert... |
||
fliege |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
da mir aus diesen angeben niemand helfen konnte, uppe ich einmal das ganze Projekt auf:
http://mitglied.lycos.de/churvus/Mumbika1.zip Bitte, ihr könnt von mir aus alles umschreiben, doch helft mir mit diesem Kollisionssystem... BITTE ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
Hubsi |
![]() Antworten mit Zitat ![]() |
---|---|---|
Sag mal, willst Du meine Festplatte einem Belastungstest unterziehen? Programme mit ununterbrochenem Festplattenzugriff starte ich nicht (s. Uhr). Zudem werden in der draw_player() bei jedem Durchlauf die Images neu geladen ![]() ![]() |
||
Den ganzen Doag im Bett umanandflagga und iaz daherkema und meine Hendl`n fressn... |
fliege |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
ok, werd' ich machen... Ich nehm' das alles eh nicht böse gemeint auf, hab' ja auch schon vorher ein paar Progsprachen durchgemacht und habe dort so einiges zu hören bekommen...Danke!Werd' schaun' das ich deine(eure) Festplatten nicht mehr solchen tests unterziehe, aber das war nicht einmal Absicht, deshalb entschuldigt mich bitte, ich muss üben!
Fliege |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group