I've created a Javascript + CSS only SpaceInvaders game, to test the performance of a complex HTML management, here there is a video:
Watch on Loo...
For further actions, you may consider blocking this person and/or reporting abuse
I lol'd at bullet.classList.add('Shooted');
I had trouble finding your game assets for the player/enemies. Are you using png or svg? My understanding is svg is the most performant for small sprites (as long as you stay away from filter effects).
I ask because I'm currently working on a project that involves svg sprites so I'm always looking for newer/better ways to handle them.
Ahah yeah that was a stupid trick to try some cool effects on the bullet when the player shoot, but it was kinda a waste of time. I want to improve it in the future but for now it’s useless 😂
I don’t use svg for enemies, I use only emoji characters because the goal of the project was different but I wish to implements some animated svg when I’ll convert all into a object oriented project..
My advice for a better svg management is to design it with a paint tool like gimp or gravit designer, which are free (or partially free) and then convert into an html format svg tag, then try to play a lot with the fill or stroke svg property using css animations and javascript code.. the next step might be learning how to handle these svg using typescript, by defining some smart classes to handle svg object, with a render method to handle animations. In my mind a solution could be a Sprite class with some properties like sheet [Image[]] and framesPerSecond [number?=0] to handle the sprite animation and the number of frames to perform at second. This is a simple example of an abstract class wich can lead you to a simplest and better organization of your sprites..
Oh good call on the emoji characters. I bet that is even better performance.
Currently I'm importing them as ReactComponents and using inline styling + styled components. That allows me to access everything in the svg while using the React state management. Works out pretty well so far in small tests, though I confess handling the context of the variables has been a bit of a headache.
Are you working with arrow functions? These functions could help you with variable scope a lot. In React I use only these function to propagate the scope of the component into its functions like render.
I am but I'm still learning too. When I import a React component I'm often unable to access the variables inside that component and I don't know why or when that happens. I'm sure it's something obvious.
My ideal developers environment would have a color coded graph of all my variables, where they were declared, their current values, and what their scope is. Passing values - especially state/context - are an endless source of frustration for this budding developer. I find myself making bloated functions just so I can write something without having to stop and debug for an hour just to pass state.
I think you might not access the component variable, but you must define variables as component properties, and set them when you declare a component instance.
For example:
You don't need to access to the component variables if you only need to keep it dynamic, use react props to handle component variations.
Nice; will you deploy to a website so people can play?
Yes I'll do when I'll complete the game, I need to do some score and game logic, and maybe a multiplayer version ^
BUT you can download the repository and try it by yourself ;)
Too much effort 😂
Please follow these instructions and you can have GitHub automatically serve the game on a website: help.github.com/en/articles/config...
Ahah yes I know you can host pages on GitHub like thism, I'll do this weekend probably, I'm converting the project to typescript so when I did it I'll create a playable version online ^
Amazing work!
Good stuff haha! Hit me with that nostalgia.
Amazing work! (+1)
Amazing work! (+2)
Great job!! Looks really cool :D
Yeah thanks, it's nothing complex just a test but I'm happy to hear that! ^
Amazing work (+3)!!!!