Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

tetris rotate shape

# General formula for rotating around origin is
xNew = x * cos(a) - y * sin(a)
yNew = x * sin(a) + y * cos(a)

# For 90 degrees it becomes
xNew = -y
yNew = x
Source by gamedev.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #tetris #rotate #shape
ADD COMMENT
Topic
Name
2+6 =