Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use amethyst::config::Config;
- use serde::{Deserialize, Serialize};
- #[derive(Debug, Deserialize, Serialize)]
- pub struct ArenaConfig {
- pub height: f32,
- pub width: f32,
- }
- impl Default for ArenaConfig {
- fn default() -> Self {
- ArenaConfig {
- height: 100.0,
- width: 100.0,
- }
- }
- }
- #[derive(Debug, Deserialize, Serialize)]
- pub struct BallConfig {
- pub velocity: [f32; 2],
- pub radius: f32,
- }
- impl Default for BallConfig {
- fn default() -> Self {
- BallConfig {
- velocity: [75.0, 50.0],
- radius: 2.5,
- }
- }
- }
- #[derive(Debug, Deserialize, Serialize)]
- pub struct PaddleConfig {
- pub height: f32,
- pub width: f32,
- }
- impl Default for PaddleConfig {
- fn default() -> Self {
- PaddleConfig {
- height: 15.0,
- width: 2.5,
- }
- }
- }
- #[derive(Debug, Default, Deserialize, Serialize)]
- pub struct GameConfig {
- pub arena: ArenaConfig,
- pub ball: BallConfig,
- pub paddle: PaddleConfig,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement