The Parallax Effect
Adding some flair to my game with graphics and a cool parallax effect!
Adding some flair to my game with graphics and a cool parallax effect!
Why on Earth did I start building a game?
A little journey back to the past and why I started this blog
In the previous post, I focused on testing with Matter.js and creating a simple car. In this post, I’m going to take it to the next level. Since my background is in UX design, I really wanted to add some graphics to this game to make it more fun to play. Matter.js has some simple methods to add textures to different objects. First, we’ll add some graphics to the car elements. You can add a sprite to any Matter.Bodies
element. It’s very simple:
render: {
sprite: {
texture: <url to texture.png>,
xScale: 1, // 1:1 scaling
yScale: 1 // 1:1 scaling
}
}
[...]
Read more about this article