Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use one image inside of Emacs buffer as a canvas #9

Closed
rexim opened this issue Aug 22, 2015 · 11 comments
Closed

Use one image inside of Emacs buffer as a canvas #9

rexim opened this issue Aug 22, 2015 · 11 comments
Assignees
Labels

Comments

@rexim
Copy link
Member

rexim commented Aug 22, 2015

We need to investigate if it's possible to do so

@rexim rexim added the question label Aug 22, 2015
@rexim rexim self-assigned this Aug 22, 2015
@rexim
Copy link
Member Author

rexim commented Sep 6, 2015

Yes! It is fucking possible! Via xpm!

@ForNeVeR, @Minoru, guys! You gotta check this out! We can use one image as a canvas for the whole game!

@rexim
Copy link
Member Author

rexim commented Sep 6, 2015

But I don't know what to do with this knowledge. Because using this technique in our game will require a lot of rewriting. :(

@rexim
Copy link
Member Author

rexim commented Sep 6, 2015

Also we need to check how smooth the animation will be with this technique.

@Minoru
Copy link
Member

Minoru commented Sep 7, 2015

What's wrong with sprites approach? Why this one is better? I'm
confused.

Regards,
Alexander Batischev

@rexim
Copy link
Member Author

rexim commented Sep 7, 2015

I understand your confusion. Let me explain everything once I'm home. :)
07.09.2015 16:39 пользователь "Alexander Batischev" <
notifications@github.com> написал:

What's wrong with sprites approach? Why this one is better? I'm
confused.

Regards,
Alexander Batischev


Reply to this email directly or view it on GitHub
#9 (comment).

@rexim
Copy link
Member Author

rexim commented Sep 8, 2015

We've already discussed this with @Minoru in the chat. A little bit later I'll put the notes of that conversation here.

@rexim
Copy link
Member Author

rexim commented Sep 9, 2015

In our current approach we insert N x M images into the buffer on each game tick. It's a pretty good approach but it has its own limitations. For example game objects can move only discretely from on cell to another. I suggest another approach where we use only one image inside of an Emacs buffer as a canvas. It gives as pixel level control over the game's frame. With this control we can implement really smooth transitions. Here is how it will look: http://www.youtube.com/watch?v=lab6cpT3HhA

@rexim
Copy link
Member Author

rexim commented Sep 9, 2015

But I'm not going to implement this in the 5th Tsoding. Such thing has to be properly planned. On the 5th Tsoding I'll focus on #32

@rexim
Copy link
Member Author

rexim commented Sep 9, 2015

All the source code that I used in the video above I've put to the one-image-canvas branch. Fill free to play with it if you want. :)

@rexim
Copy link
Member Author

rexim commented Sep 10, 2015

Since we know this technique is possible I close the issue.

@rexim
Copy link
Member Author

rexim commented Sep 10, 2015

Checked this stuff on Windows 8.1, Emacs 24.5. Works good too and consumes even less CPU than on my Ubuntu (25% vs 30%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants