TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
time and space
1.4k
31
57.1k
Boxing/unboxing problem
Apr 9 2012 2:10 PM
The following code snippet crops up quite often in my code where collision rectangles need to be calculated:
bullet.collisionRect.X = (int)bullet.position.X;
bullet.collisionRect.Y = (int)bullet.position.Y;
Is there any way round the unboxing/cast? The collision rects are XNA Rectangles, position X, Y are floats (stored in a Vector2).
Reply
Answers (
4
)
Making a moving missile sprite face the player (2D)
Need help drawing node like map