Discord
Login
Community
DARK THEME

Building

A building made in Microstudio, no 3d engine. Use it to make games like the og gta or something.

https://microstudio.dev/i/DanMan97/3d_building/

Nice... I will definitely expand on this..
Great job man.. really impressing.

Thanks

I just updated it so you can create multiple buildings and they all work

You can optimize this code. Because these values never change

   this.x2 = this.building_top_x+this.cam_x+this.building_height/2
   this.y2 = this.building_top_y+this.cam_y+this.building_height/2 

set them in the constructor

   this.x2 = this.building_top_x+this.building_height/2
   this.y2 = this.building_top_y+this.building_height/2 

and the "mathstuff" function only add the current camera position.

   this.draw_x2 = this.x2 + this.cam_x
   this.draw_y2 = this.y2 + this.cma_y

Also try not to count each vertex twice.

draw

   screen.fillPolygon( this.draw_x2, this.draw_y2 .... )

You should also consider whether to draw invisible walls. Now you draw 6 faces. And this can be reduced to 3.

Ok I'll keep this in mind

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community