Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sprite "camera" problem

Author
Message
Baiame
18
Years of Service
User Offline
Joined: 8th May 2006
Location:
Posted: 26th Aug 2006 12:59 Edited at: 28th Aug 2006 12:09
Hello. In my game, I wanted the camera to always be set to the midpoint of the player sprite and the crosshair sprite. It works by getting old X and Y values of this point before any movement, then new X and Y values after all movement, then offsetting everything in the world by -(newx-oldx) and -(newy-oldy) (just as is normally done). However, I find that when the player moves forward or left, both the crosshair and the player move (they should only appear to move from crosshair movements). I can't even begin to see where this problem lies. Any help would be greatly appreciated.

The game has an FPS-style control system, and WSAD are used for basic movement.

EDIT- I noticed that the player moving in any direction can screw it up, depending on the player's orientation.

EDIT2- I guess the problem stemmed from the fact that sprite x() and its Y counterpart return integers rather than floats. I'd have to set up my own coordinate system. Instead, I'll switch to using normal planes created as normal DBP objects. Nevermind on this problem.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-25 07:36:49
Your offset time is: 2024-09-25 07:36:49