obscene
Member
I have a script that generates random foreground rocks in a room.
The left image is taken from a normal Windows compile and the right image is using the YYC.
There is also a script for the foreground cobwebs which also looks different between versions, though this isn't an issue as much as the rock covering up things the player needs to see.
Both of these scripts begin with random_set_seed(room) so that the results are always the same in each room when you leave/return.
Example:
Any ideas?
The left image is taken from a normal Windows compile and the right image is using the YYC.
There is also a script for the foreground cobwebs which also looks different between versions, though this isn't an issue as much as the rock covering up things the player needs to see.
Both of these scripts begin with random_set_seed(room) so that the results are always the same in each room when you leave/return.
Example:
Code:
/// Makes a bunch of random rocks in the foreground
random_set_seed(room);
var f;
var xx;
var yy;
repeat(20)
{
// Find ground weighted towards edge of room
do
{
r=random_range(8,32);
if room_width==1920 xx=960+(r*r)*choose(-1,1);
else xx=random(room_width);
if room_height==804 yy=402+(r*r)*choose(-1,1);
else yy=random(room_height);
xx=clamp(xx,0,room_width);
yy=clamp(yy,0,room_height);
}
until (collision_point(xx,yy,par_solid_ground,true,false));
// Move away from open spaces
var miss=0;
repeat (100)
{
var d=random(360);
var x2=xx+lengthdir_x(200,d);
var y2=yy+lengthdir_y(200,d);
if (!collision_point(x2,y2,par_solid_ground,true,false))
{
miss+=1; // too many misses indicates island / ledge
if x2 > 0 && x2 < room_width && y2 > 0 && y2 < room_height
{
xx+=lengthdir_x(50,d-180);
yy+=lengthdir_y(50,d-180);
}
}
}
// Make Rock
if (miss < 50)
{
var obj=choose(obj_boulder1_fg,obj_boulder2_fg,obj_boulder3_fg,obj_boulder4_fg);
with (instance_create(xx,yy,obj))
{
depth=random_range(-60,-99);
image_angle=choose(0,270)+random_range(-40,40);
image_xscale=random_range(3,5)*choose(-1,1);
image_yscale=random_range(3,5)*choose(-1,1);
}
}
}