- Home /
creating a 2d game object like doom
I'm planing on making a game and as a cheap short cut I want to have 2d objects walking around like in the original doom game and the graphics will change depending on what side you look from, what way it is facing, and possible other things if its does something or something happens to it. I think I would just have to create a script checking to see where the camera is in relation to the object and which way the object is facing in the update function and then have the script change the image based on what you put into a transform. I'm not full sure how to go about this but here is an attempt at part of it. if ( pos.x < maincamera.x && pos.y > maincamera.y && rotation.z <= 90 && rotaion.z > 180 && beingattack =true) {image = leftsideattacked;}
If it helps here is a Google found image as an example.
This only barely rates as a cheap shortcut - unless you're a skilled 2D artist but not particularly quick with 3D modelling, of course.
im doing the same. would using interactive sprites work?
Answer by $$anonymous$$ · Nov 13, 2012 at 11:15 PM
Use a billboard shader to render the object and a 3d representation for game logic. Before rendering the object check for the angle between the enemy's forward direction and the vector pointing from the enemy to you. You can change the displayed texture based on this angle value.
Well thanks for replying but, after hours of research, I think I solved it. I just want to run a few test and I'll leave my script here.
Your answer
Follow this Question
Related Questions
How to form copies of yourself that follow you when you walk? (2D Platformer) 2 Answers
How to handle a MASSIVE amount of game objects? 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Score system 1 Answer
2d animation how to stop your animation and set a condition 0 Answers