Ich arbeite an meinem Privatprojekt Minewhite (Ein Minecraft 2D Klon). Ich mache grad dass wenn man die Blöcke abbaut die Risse entstehen und erst wenn der Block keine Health mehr hat soll der abgebaut werden. Jedoch gibt es 2 Probleme:
1. Der erste Riss bleibt die ganze Zeit da.
2. Die weiteren Risse beim 2, 3 ... Block verschwinden zwar, jedoch wird beim Abbauen nur der vierte (letzte) Sprite angezeigt. Also die ersten Risse wo noch klein sind kommen garnicht.
Hier der Code von der Erde (einer vo vielen Blöcken...)
Create Event >
Step Event >
Alles anzeigen
1. Der erste Riss bleibt die ganze Zeit da.
2. Die weiteren Risse beim 2, 3 ... Block verschwinden zwar, jedoch wird beim Abbauen nur der vierte (letzte) Sprite angezeigt. Also die ersten Risse wo noch klein sind kommen garnicht.
Hier der Code von der Erde (einer vo vielen Blöcken...)
Create Event >
Step Event >
GML-Quellcode
- [code]global.dirt_health -= 1
- if global.dirt_health < 10 and instance_exists(obj_abbau1) = false
- {
- instance_create(x,y, obj_abbau1)
- }
- if global.dirt_health < 7.5 and instance_exists(obj_abbau2) = false
- {
- instance_create(x,y, obj_abbau2)
- }
- if global.dirt_health < 5 and instance_exists(obj_abbau3) = false
- {
- instance_create(x,y, obj_abbau3)
- }
- if global.dirt_health < 2.5 and instance_exists(obj_abbau4) = false
- {
- instance_create(x,y, obj_abbau4)
- }
- if instance_exists(obj_dirt_auswahl) = false and instance_exists(obj_grass_auswahl) = false and instance_exists(obj_stone_auswahl) = false and
- instance_exists(obj_tree_auswahl) = false and instance_exists(obj_leaves_auswahl) = false and global.dirt_health <= 0
- {
- instance_create(mouse_x, mouse_y, obj_dirt_auswahl)
- instance_destroy()
- with(instance_position(x,y,obj_abbau1))instance_destroy()
- with(instance_position(x,y,obj_abbau2))instance_destroy()
- with(instance_position(x,y,obj_abbau3))instance_destroy()
- with(instance_position(x,y,obj_abbau4))instance_destroy()
- }[/code]