Heute zeige ich euch, wie man Blöcke bauen und auch abbauen kann! :)
Hier der Code, fürs anbauen eines Blockes:
VECTOR tempb;
VECTOR temp1b;
VECTOR ent_pos1;
VECTOR normal_pos1;
ANGLE normal_pan1;
tempb.x = mouse_pos.x;
tempb.y = mouse_pos.y;
tempb.z = 30;
vec_set(temp1b,tempb);
vec_for_screen(tempb,camera);
temp1b.z = 30000;
vec_for_screen(temp1b,camera);
c_trace(tempb,temp1b,IGNORE_ME|IGNORE_PASSENTS|IGNORE_SPRITES|USE_POLYGON|SCAN_TEXTURE);
if (you) // FALLS EINE ENTITY GEFUNDEN WURDE
{
vec_set(ent_pos1,mouse_ent.x);
vec_set(normal_pos1,vector(64,0,0));
vec_to_angle(normal_pan1,normal);
vec_rotate(normal_pos1,normal_pan1);
vec_add(ent_pos1,normal_pos1);
ent_create(file_cube_str,ent_pos1,cube_act);
}
-------------------------------------------------------------------------------------
➜ Mein Kanal:
/ megavalencia10
➜ Mein Comedy-Kanal (real Life):
/ ufonetv
MV10 - Hier liegt die Lösung!