Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const star = {
- x: window.innerWidth,
- y: window.innerHeight
- };
- const random = (min, max) => {
- return Math.floor(Math.random() * (max - min)) + min;
- };
- cost makeStar = star => {
- const newStar = { ...star };
- newStar.x = random(0, star.x);
- newStar.y = random(0, star.y)
- return newStar;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement