Jump to content


alexandervrs

Member Since 21 Feb 2012
Offline Last Active Today, 03:38 PM

Topics I've Started

Problems With Moving Platforms

Today, 03:38 PM

Tried to mod the Grandma Engine in order to add moving platforms to it so I can understand collisions better. However I got two issues.

 

For platforms moving horizontally, the player's friction gets eliminated the moment it lands on it.

 

For platforms moving vertically I also see a 1 pixel offset from time to time, especially when jumping on the platform while it is moving.

 

Finally the jumpthrough functionality is ruined.

 

Download gmz here.

 

---

 

A question I also have is,

 

What is the correct code for checking the player's bottom position of the bounding box against the bounding box top of other object? e.g. A player checking that there is floor below him.

Why place_meeting(x, y+1, obj_floor) does not always work? Especially when falling on a floor that moves upwards, it will fail most of the times.
This also often fails as well collision_rectangle(bbox_left, bbox_bottom+1, bbox_right, bbox_bottom+1, obj_wall, 1, 1);

 


Inverted Surface Doesn'T Fade Out

17 May 2013 - 08:45 AM

I am trying to create a quick flash & fade out effect with surfaces.
What would exactly happen is the game view flashing with inverted colors and then quickly fading out.

The problem is the surface appears inverted but it doesn't fade out smoothly after, it also seems like the draw event is ignoring any draw_set_alpha() I give it if I use draw_set_blend_mode_ext()

Step This just fades out the alpha

if (_alpha > 0) {
    _alpha = _alpha-_speed;
}
if (_alpha < 0.01) {
    _alpha = 0;
    instance_destroy();
}

Draw This draws the inverted fade


if (not(surface_exists(_surface))) {
    _surface = surface_create(view_wview[0], view_hview[0]);
    _view_surface = surface_create(view_wview[0], view_hview[0]);
    view_surface_id[7] = _view_surface;
    view_xview[7] = view_xview[0];
    view_yview[7] = view_yview[0];
    view_wview[7] = view_wview[0];
    view_hview[7] = view_hview[0];
    view_xport[7] = view_xport[0];
    view_yport[7] = view_yport[0];
    view_wport[7] = view_wport[0];
    view_hport[7] = view_hport[0];
    view_hborder[7] = view_hborder[0];
    view_vborder[7] = view_vborder[0];
    view_object[7] = view_object[0];
}

surface_set_target(_surface);
    draw_clear_alpha(c_black, 0);
    draw_set_alpha(_alpha); //This is completely ignored
    surface_copy(_surface, 0, 0, _view_surface);
    draw_set_blend_mode_ext(bm_inv_src_color, bm_inv_dest_color);
surface_reset_target();

draw_surface(_surface, view_xview[0], view_yview[0]);

draw_set_blend_mode(bm_normal);
draw_set_alpha(1);


Exclude Objects From Surface & View_Surface_Id

30 April 2013 - 10:47 AM

I am using GameMaker Studio and practicing around with surfaces.

Although I am a bit confused about how GameMaker studio handles the drawing.

 

1. I need to have a background in a surface that is wavy.

2. the player not be affected by the wave effect. 

3. I would like not to use another view if possible for view_surface_id. (I am getting a black screen if I don't)

 

https://dl.dropboxus...surfaceWavy.gmz


Repeating Backgrounds To Create A Scrolling Plane?

14 April 2013 - 02:01 PM

I am trying to create an endless 3D plane 2-point perspective scene. Problem is that I have 3 d3d walls that I need to scroll towards the camera endlessly to create a "running towards" effect. I am using d3d_transform_add_translation() but this is actually moving the walls which results in the walls going towards the camera and eventually break out of the scene. I need them not to change position but appear to be moving endlessly like repeating backgrounds.

 

My drawing code for the scene is as follows:

 

 

 

draw_set_color(c_white);


d3d_set_perspective(true);
d3d_set_projection(x, y, 0, x+12, y, 0, 0, 0, 1);


_step -=1;
d3d_transform_add_translation(_step, 0, 0);


d3d_draw_floor(-512,-512,-32,512,512,0,sprite_get_texture(spr_ground, 0), 4, 8);
d3d_draw_floor(-512, -512, 32, 512, 512, 0, sprite_get_texture(spr_sky, 0), 4, 8);


_step -=1;
d3d_transform_add_translation(_step, 0, 0);
d3d_draw_floor(-512, -512, 30, 512, 512, 0, sprite_get_texture(spr_sky2, 0), 4, 8);


d3d_transform_set_translation(0, 0, 0);


d3d_set_projection_ortho(0, 0, 336, 224, 0);
d3d_transform_stack_clear();
 

 

You can download the gm81 or the gmz here too.


Confine Instance Inside Solid?

26 March 2013 - 10:24 AM

I would like to check if a collision with a precise solid occured and confine the instance inside it so it would be impossible to get out.

I have a roulette type game but when the ball hits the collision handler object then sometimes it might not be entirely confined in it.

 

https://dl.dropbox.c...ouletteType.zip

 

Also if anyone has an idea of making the collision triangles flexible with code and not images, it would be appreciated.