Hallo liebe Game Maker Community,
ich habe ein "erweitertes" problem mit einer distanzabfrage zu bekämpfen. Ich habe drei sprites (Zug Sprite + 2 Türen)
Am anfang fahre alle gleich los bleiben dann bei einer bestimmten stelle stehen und nach ablauf einer bestimmten zeit öffnen sich die Türen.
Ist wieder eine bestimmte zeit verstrichen schließen sie sich wieder und hier kommt das problem: Der Zug fährt ab aber die Türen bleiben da...
könnt ihr mir hierbei helfen?
// Create
// Step
Alles anzeigen
ich habe ein "erweitertes" problem mit einer distanzabfrage zu bekämpfen. Ich habe drei sprites (Zug Sprite + 2 Türen)
Am anfang fahre alle gleich los bleiben dann bei einer bestimmten stelle stehen und nach ablauf einer bestimmten zeit öffnen sich die Türen.
Ist wieder eine bestimmte zeit verstrichen schließen sie sich wieder und hier kommt das problem: Der Zug fährt ab aber die Türen bleiben da...
könnt ihr mir hierbei helfen?
// Create
// Step
GML-Quellcode
- // DOORS FOLLOW LEFT
- if id = inst_D71289A2
- if global.door_wait[0] = 40
- if x>828
- {
- x-=8
- }
- if id = inst_D71289A2
- if x = 828
- {
- global.door_wait[0] -=0.1
- }
- if id = inst_D71289A2
- if global.door_wait[0] = 0
- {
- x-=8
- }
- // DOORS FOLLOW RIGHT
- if id = inst_7468B381
- if global.door_wait[1] = 40
- if x>902
- {
- x-=8
- }
- if id = inst_7468B381
- if x = 902
- {
- global.door_wait[1] -=0.1
- }
- if id = inst_7468B381
- if global.door_wait[1] = 0
- {
- x-=8
- }
- // Door Opening
- if id = inst_D71289A2
- if global.door_wait[0]<30
- if global.door_closing = 0
- {
- x-=4
- }
- if id = inst_D71289A2
- if global.door_wait[0]<30
- {
- if x<752
- x=752
- global.door_wait[0] -=0.1
- }
- if id = inst_7468B381
- if global.door_wait[1]<30
- if global.door_closing = 0
- {
- x+=4
- }
- if id = inst_7468B381
- if global.door_wait[1]<30
- {
- if x>977
- x=977
- global.door_wait[1] -=0.1
- }
- // Not negative
- if global.door_wait[0]<10
- global.door_closing = 2
- if global.door_wait[1]<10
- global.door_closing = 2
- if global.door_wait[0] <0
- global.door_wait[0] = 0
- if global.door_wait[1] <0
- global.door_wait[1] = 0
- // Door Closing
- if id = inst_D71289A2
- if global.door_wait[0]<20
- if global.door_closing = 2
- {
- x+=4
- }
- if id = inst_D71289A2
- if global.door_wait[0]<20
- {
- if x>828
- x=828
- }
- if id = inst_7468B381
- if global.door_wait[1]<20
- if global.door_closing = 2
- {
- x-=4
- }
- if id = inst_7468B381
- if global.door_wait[1]<20
- {
- if x<902
- x=902
- }