OFFICIAL New Video Tutorial Series: Space Mods

rmanthorp

GameMaker Staff
Admin
GameMaker Dev.
1585909657003.png
Our latest series of video tutorials for GameMaker Studio 2 (GMS2) is a return to our arcade shooter Space Rocks. Using your existing Space Rocks project, our new series takes on 5 different topics to really expand your game and knowledge. Once again these tutorials can be followed in GMS2 using the free trial without coding, by using the drag and drop visual language, or by coding with GameMaker Language.

Presented again by Friendly Cosmonaut, the "Space Mods" series covers Cameras for expanding the playing field and following the action. Parallax Backgrounds for adding movement and depth to the look of space. Enemy Factions for filling out your game with antagonistic ships. Power-ups to the player ship to turn the tide of battle and lastly Effects to really polish your game off with pretty particles.

Check out the expanded series below and look forward to more tutorials from us in the future.

VIDEO PLAYLISTS
GML (GameMaker Language):

DnD™ (Drag and Drop™ visual code):
 

kburkhart84

Firehammer Games
I checked the one about adding parallax...I'm not convinced it is exactly what it is supposed to be. It directly sets the layer x/y to the position of the ship multiplied by a value. This doesn't look, bad in the videos...but notice that the lower the x/y position of the ship, the less of a difference that is. So if you use value 0.9, at 500/500, the layer would be at 450/450. At position 100/100, the layer would be at 90/90. So the first spot makes a difference of 50 pixels each way, and the second one is only 10 pixels. In other words, the background speed differential will cause it to move faster the further to the lower right you are, and slower the close to the upper left you. It looks OK, but I think if the video is going to do it that way, than it should explain it that way so it is understood that it is a "trick" and not an accurate thing. If someone takes this code and uses it in a much larger game world they will begin to notice it I would think.

Now, maybe I'm missing something and the method actually works fine(I haven't tested it), I'm just going by the logic of it. If I'm wrong, feel free to explain why.
 

jonjons

Member
I rebember making an auto parallax during the game jam. It moves based on the ship direction, and speeds up based on the ship speed.
Iam sure theres a simple way ro do it using the image angle
but this was the weird pile of crp i came up with...

GML:
//---------------------//--BACKGROUND-MOVE--//--------------------------------
if ( instance_exists(obj_ship) )
{
//var spdH = obj_ship.hspeed;
//var spdV = obj_ship.vspeed;

var plr_dir = obj_ship.direction;
var plr_speed = clamp(obj_ship.speed - 0.02, -0.1, 0.1);



if (plr_dir >= 0  && plr_dir <= 90)
{
    bg_angY = plr_dir * plr_speed;
    bg_angX = (plr_dir-90) * plr_speed;
}
if (plr_dir >= 90 && plr_dir <= 180)
{
    bg_angY = (plr_dir-180) * -plr_speed;
    bg_angX = (plr_dir-90) * plr_speed;
}
if (plr_dir <= 359 && plr_dir >= 270)
{
    bg_angY = (plr_dir-359) * plr_speed;
    bg_angX = (plr_dir-270) * -plr_speed;
}
if (plr_dir <= 270 && plr_dir >= 180)
{
    bg_angY = (plr_dir-180) * - plr_speed;
    bg_angX = (plr_dir-270) * - plr_speed;
}




if ( layer_exists("bg1") )
{
    layer_hspeed("bg1", bg_angX );
    layer_vspeed("bg1", bg_angY );
}
if ( layer_exists("bg2") )
{
    layer_hspeed("bg2", bg_angX * 1.5);
    layer_vspeed("bg2", bg_angY * 1.5);
}
if ( layer_exists("bg2") )
{
    layer_hspeed("bg3", bg_angX * 2);
    layer_vspeed("bg3", bg_angY * 2);
}


}
 
Top