CommitLog |
This commit is contained in:
parent
00d04b4900
commit
80607ec47c
3 changed files with 51 additions and 14 deletions
|
@ -26,8 +26,45 @@
|
|||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>generated_count = 0;
|
||||
generated_areas = array_create(1000);
|
||||
generated_areas[10000] = 0;
|
||||
|
||||
///Generate World
|
||||
|
||||
|
||||
var startx = view_xview[0];
|
||||
var starty = view_yview[0]
|
||||
var xmax = startx + view_wview[0];
|
||||
var ymax = starty + view_hview[0];
|
||||
|
||||
xmax = xmax - (xmax % 32);
|
||||
ymax = ymax - (ymax % 32);
|
||||
|
||||
startx = startx - (startx % 32);
|
||||
starty = starty - (starty % 32);
|
||||
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="2" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>generate_world();
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
|
|
@ -83,7 +83,6 @@ view_yview[0] = y - view_hview[0]/2;
|
|||
<string>direction = image_angle
|
||||
speed += 5
|
||||
|
||||
generate_world();
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
///Generate World Chunks
|
||||
|
||||
|
||||
var xmax = view_xview[0] + view_wview[0];
|
||||
var ymax = view_yview[0] - view_hview[0];
|
||||
|
||||
show_debug_message(xmax);
|
||||
show_debug_message(ymax);
|
||||
|
||||
for(var xx = view_xview[0]; xx < xmax;xx+=32)
|
||||
for(var xx = startx; xx < xmax;xx+=32)
|
||||
{
|
||||
for(var yy = view_yview[0]; yy < ymax;yy+=32)
|
||||
{ var expe = string(xx)+string(yy)
|
||||
for(var i = 0; i <= obj_controller_world_gen.generated_count; i++)
|
||||
for(var yy = starty; yy < ymax;yy+=32)
|
||||
{
|
||||
var expe = string(xx)+string(yy)
|
||||
var should_continue = false;
|
||||
for(var i = 0; i <= count; i++)
|
||||
{
|
||||
if(obj_controller_world_gen.generated_areas[i] == expe)
|
||||
{
|
||||
return 0;
|
||||
should_continue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(should_continue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
obj_controller_world_gen.generated_areas[obj_controller_world_gen.generated_count] = expe;
|
||||
obj_controller_world_gen.generated_count ++;
|
||||
|
||||
|
|
Reference in a new issue