I have been working on just the fake 3D engine of my game for days now and can't seem to create the view in the video below. I think I have figured out how to scale the sprites correctly. I can't seem to figure out how to rotate the world sprites. I can only slide world sprites on the x axis to the left or right depending on which player object rotation keys are used. I'm a but confused on how to duplicate how the video does full 360 rotation so the player can see objects in front or behind, and how to actually make the world objects look like they are rotating.

Once my facingDir variable hits 360 or -360 it gets reset to 0. I'm not sure if this is part of the problem, but I don't see any other way to fake a full 360 rotation and have accurate readings.

I only want to use 2D math / functions for this project.

View script used by world objects

objectSprite=argument0

//Draw

if x>obj_player.x //Draws sprite if in front of player

{draw_sprite_ext(argument0,0,x+obj_player.facingDir,

sprite_height+400,obj_player.scaling,obj_player.scaling,0,c_white,1)}

//Scaling Size Limit

if obj_player.scaling>=4

{obj_player.scaling=4}

else if obj_player.scaling<=1

{obj_player.scaling=1}

Code used by world objects to access view script

script_execute(scr_view,spr_SPRITE_NAME)

Player create event code

facingDir=0

scaling=0

viewSector=1

Player step event code

//Restart Game

if keyboard_check_pressed(vk_tab)

{game_restart()}

//Rotate Limit

if facingDir>360

{facingDir=0}

else if facingDir<-360

{facingDir=0}

//Rotate Left - Rotates Right View - Negative facingDir

if keyboard_check(ord('A'))

{facingDir-=2}

//Rotate Right - Rotates Left View - Positive facingDir

if keyboard_check(ord('D'))

{facingDir+=2}

//Move Forwards

if keyboard_check(ord('W'))

{motion_set(facingDir,4)

scaling+=0.2}

//Move Backwards

if keyboard_check(ord('S'))

{motion_set(facingDir,-4)

scaling-=0.2}

//Stop Movement

if keyboard_check_released(ord('W')) or keyboard_check_released(ord('S'))