Showing results for
on sokoban.iolivia.me...In this section we'll add some logic for more intelligent player movement.
Movement components
First, we need to make our code slightly more...
Movement components
First, we need to make our code slightly more...
...up of multiple components, for example a player might be made up by Position, Renderable & Movement, while the floor might just be Position & Renderable...
...We previously discussed Position, Renderable and Movement - we'll skip movement for now. We will also need some components to identify each entity - for...
...As you might have noticed this is not a great experience as a player because you don't have good control over the movements...
...In this section we'll add some logic for more intelligent player movement.
Movement components
First, we need to make our code slightly more...
Movement components
First, we need to make our code slightly more...
Gameplay
The player character is able to move and push boxes on the field. Many (but not all!) games have some kind of objective...
The player character is able to move and push boxes on the field. Many (but not all!) games have some kind of objective...
...10, ..position }, Renderable { path: "/images/player.png".to_string(), }, Player {}, Movable {}, )) } }
Now for the map loading.
#![allow(unused)] fn main() { // map.rs use crate...
Now for the map loading.
#![allow(unused)] fn main() { // map.rs use crate...
...For example, to get our player blinking we'll have three animation frames:
- our current player with the eyes open
- player with eyes a...
- our current player with the eyes open
- player with eyes a...
...have a fairly simple game and our logic for input and movement is not actually that complex, we also don't have that many...