Skip to content
Snippets Groups Projects
Commit 21f979c8 authored by Ilari Tilli's avatar Ilari Tilli
Browse files

border version 1.0

parent 9d9eac3e
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dtek0065_project.iml" filepath="$PROJECT_DIR$/.idea/dtek0065_project.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/DTEK0065_project.iml" filepath="$PROJECT_DIR$/.idea/DTEK0065_project.iml" />
</modules>
</component>
</project>
\ No newline at end of file
import React, {Component} from "react";
class App extends Component {
constructor() {
super();
this.state = initialState;
}
}
export interface ICanvasBoard {
height: number;
width: number;
}
const CanvasBoard = ({ height, width }: ICanvasBoard) => {
return (
<canvas
style={{
border: "3px solid black",
}}
height={height}
width={width}
/>
);
};
import { ChakraProvider, Container, Heading } from "@chakra-ui/react";
import { Provider } from "react-redux";
import CanvasBoard from "./components/CanvasBoard";
import ScoreCard from "./components/ScoreCard";
import store from "./store";
const App = () => {
return (
<Provider store={store}>
<ChakraProvider>
<Container maxW="container.lg" centerContent>
<Heading as="h1" size="xl">SNAKE GAME</Heading>
<CanvasBoard height={600} width={1000} /> //Canvasboard component added
</Container>
</ChakraProvider>
</Provider>
);
};
export default App;
// how the snake moves on the board
moveSnake() {
......@@ -14,7 +54,6 @@ class App extends Component {
// updates the direction of the snake from the input it gets
changeDirection() {
//homonaama
}
// checks if food is eaten
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment