Code Monkey home page Code Monkey logo

Comments (6)

Fabrizio-Caruso avatar Fabrizio-Caruso commented on May 13, 2024

Hi! Thanks for following my project!
I do not understand the issue. What is flickering for you that should not be flickering?
The green slowdown power-up is supposed to flicker.
The enemies are redefined characters and move in a grid.
Their jerky movement is the expected behavior (in the current implementation at least for the moment).

REMARK: The game is written in C and very time sensitive code is impossible in C.

Buffering all writes to screen and waiting for a rasterline would probably make the code much more complicated and it could have a huge performance impact.
If the graphics quality improves significantly and it can be done without touching the non-hardware specific code, I may consider this feature in the future.

from cross-lib.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on May 13, 2024

If I try to do something like
while(VIC.rasterline>40){}
cputc(image->_imageData);

i.e., wait for a low value of the rasterline before writing onto video memory, I do not see any improvement and the game is significantly slowed-down.

from cross-lib.

matozoid avatar matozoid commented on May 13, 2024

Okay, with flickering I mean that every time a monster moves it disappears for a splits second. So instead of moving from a to b, it seems to disappear from a and reappear on b.

With a raster interrupt I mean putting your code in an interrupt handler that fires on a specific rasterline. It's what most games do to hide screen updates.

If this can't be done from C then this issue can be closed, I guess :-)

from cross-lib.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on May 13, 2024

This cannot be done reasonably in C because it would require handling interrupts in C, which is (close to) impossible.
Some cross-compilers provide some tools but discourage to use them (e.g., CC65) to do anything time-critical.
I am not writing a C64 version of the game. If you look at the code, you'll see that all versions share the same code except very few bits about input, sound and graphics (and even this is shared among many targets).

My project is about a universal 8 bit game (i.e., it has to be coded in a way that a single Makefile can generate binaries for nearly all 8 bit computers from the same code). The game should be fun and very playable. Eye-candy is not the highest priority but I DO plan to improve it. In the future I may use sprites instead of simple characters (I have already implemented a prototype).

from cross-lib.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on May 13, 2024

So, what you ask is not impossible but extremely hard in C. It would require lots of Assembly and therefore it would not be in the scope of a universal project. (I have used small fragments of Z80 Assembly for sound in Amstrad CPC and graphics in VG-5000 because I had not much choice).
I will close the issue BUT I will try to do my best to improve graphics because that is where my little game is a bit weak. (I am actually doing it right now).
Thanks a lot for following my project!

from cross-lib.

matozoid avatar matozoid commented on May 13, 2024

And thank you for considering this :-)

from cross-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.