23 lines
695 B
Python
23 lines
695 B
Python
from rest_framework.views import APIView
|
|
from rest_framework.response import Response
|
|
from rest_framework import permissions, status
|
|
|
|
from django.http import HttpRequest
|
|
|
|
from . import config
|
|
|
|
class GameConfigView(APIView):
|
|
|
|
permission_classes = (permissions.AllowAny,)
|
|
|
|
def get(self, request):
|
|
config_data = {
|
|
"BALL_SIZE": config.BALL_SIZE,
|
|
"PADDLE_SPEED_MAX": config.PADDLE_SPEED_MAX,
|
|
"PADDLE_SIZE_HEIGHT": config.PADDLE_SIZE_HEIGHT,
|
|
"PADDLE_SIZE_WIDTH": config.PADDLE_SIZE_WIDTH,
|
|
"PADDLE_RAIL": config.PADDLE_RAIL,
|
|
"BALL_SPEED_INC": config.BALL_SPEED_INC,
|
|
"BALL_SPEED_START": config.BALL_SPEED_START
|
|
}
|
|
return Response(config_data, status = status.HTTP_200_OK) |