求教新问题:如何根据..请教,如何根据object实例的instance-id得到其object-name?或者是直接根据某点坐标A(x,y)得到其位置上是否有某个对象,得到对象名称,可以应用于方便在别的位置创建该对象???
//在object0里var vDir0;vDir0=point_direction(x,y,mouse_x,mouse_y);//坦克坐标到鼠标坐标的角度instance_create(x + lengthdir_x(炮管长度,vDir0),y + lengthdir_y(炮管长度,vDir0),object1); 6楼2018-10-22 08:38 回复(6) frwhat 算法提高 6 过来看看。 7楼2018-10-23 19:30 回复...
For my current project, I run into this problem with 1000 units, and from the get-go I knew I needed something smarter, so I have a separate single-instance "unit-leader" object that holds a large 2D-array denoting which unit is in which "box", so that if a unit wants to check ...
1、创建一个object,命名为obj_temp_datacollect。 2、在Step里输入下面这段代码,也可自行在with里面添加其他内容,image_alpha,image_blend之类的。 ifkeyboard_check_pressed(ord("P")){ini_open("temp_mark.ini");for(vari=0;i<instance_count;i++;){with(instance_id[i]){varoobject_name=object_get_...
ins = instance_create(0,0,obj2);with(ins) { ds_list_add(L,id);}这次再运行,游戏就不会报错了,而且会成功的将obj2的id添加到列表中,因为使用var定义的变量,只作用于代码,与实例毫无关系。所以说,这种语句是正确的。有的孩子特么的抠字眼,就说了,其实我有种写法更好,就像下面这样:ins = instance_...
这样说吧,类型相当于object,实例是instance。我在instance中想用代码获得其父类类型的object名。或者实例化一个父类类型的instance。GML中有个函数是object_get_parent(ind),但是object_get_parent(self)得数总是-1。 禁言|10楼2009-06-26 15:48 回复 ...
object与sprite一样而instance是靠著object创造出来的,他本身也有一个独一无二的id(instance与object是不一样的东西喔,要注意一下) 使用某物件处理有关draw的函式,画出来的图深度将与画他出来的实例相同,一个可以变换深度的方法 就是画图前先改变实例的深度(depth),但是这样一来也会波及到本身的sprite,所以执行...
“闹钟计数 += 1;” 闹钟调用脚本函数 function iy_Alarm(){ return o_Ctrl1.image_index + NZ//要确保o_Ctrl1是唯一的 } 每个房间运行前都有一个控制类 o_Ctrl1 提前放入房间中 o_Ctrl1创建事件 //创建调用闹钟的多个Object2实例 var i=0; repeat (10) { instance_create_layer(x + i * 32,y...
Skip to main content GameMaker Manual GameMaker Manual Index Introduction To GameMaker Quick Start Guide Licencing & Versions GameMaker IDE GameMaker Runner Settings The Asset Editors Additional Information GameMaker Language
GMLNeed help with connecting an object to an enemy… In the project I am working on, a 2d platformer, I am planning on having an enemy that holds a shield. The trouble I am having is how I am supposed to tell the shield which instance of the enemy (in case there are multiple inst...