Git Product home page Git Product logo

Comments (7)

williamfiset avatar williamfiset commented on June 16, 2024

When you get back we can make a branch off of the development branch to solve this issue.

from fruitfever.

micahstairs avatar micahstairs commented on June 16, 2024

If this is an object in the game then use FruitFever's addToThings method. If this going to be part of the GUI or something then it will end up being done through ScreenHandler.

from fruitfever.

micahstairs avatar micahstairs commented on June 16, 2024

"And another thing, why do we need animate and draw? should they not be combined into a single method?"

Can you please be more specific, I'm not sure which 'draw' method you speak of. The Thing class only has an animate method.

from fruitfever.

williamfiset avatar williamfiset commented on June 16, 2024

Perhaps I am misunderstanding how drawing and animating work. But some methods are called draw, others are called animate.

If I am understanding correctly these are all different ways of placing something on the screen, no?

// FruitFever
Block.drawBlocks();
player.animate();
ScreenHandler.adjustHearts(player.getLives());
things.get(i).animate();

//ScreenHandler, other rendering methods
public void drawEndOfLevel()
public void shiftLevelLabels(int shift) 
public void addBackground()

Do you agree there's work to be done renaming methods?

from fruitfever.

williamfiset avatar williamfiset commented on June 16, 2024

Currently drawing things is happening like this:

for (int i = 0; i < list.size(); i++) {
    if (condition == true) {
        removeItemFromList();
    } else {
          animateSomeThing();
        }
}

if (something != null) {
    drawSomeThingOnScreen();
}

player.animate();

In my idealized version of FF this is how it should happen.

// I named all of these draw but they could be called animate too.

// Arguments are cool, lets use them
screenHandler.drawEndOfLevel(levelComplete);
screenHandler.drawLevelSelection(levelComplete);


drawAllText(hintText, levelTexts);
drawAllThings();

player.draw();

// Even though they're being drawn in other classes 
// it's fine since we know where they are.
Block.drawBlocks(); 
ScreenHandler.drawHearts();

from fruitfever.

williamfiset avatar williamfiset commented on June 16, 2024

@micahstairs About drawing different items to the screen would it be a good idea to have a Wiki page? Or is that overkill?

from fruitfever.

micahstairs avatar micahstairs commented on June 16, 2024

NOTE: I use the word 'draw' for when I'm drawing a new screen. Ex: drawMainMenu, drawPauseMenu, drawLevelSelection, drawEndOfLevel.

// FruitFever
Block.drawBlocks(); // No idea what this does, you made it
player.animate(); // This is Thing.animate()
ScreenHandler.adjustHearts(player.getLives()); // This just adjusts the visibility and the location of GImages already on the screen
things.get(i).animate(); // This is Thing.animate()

//ScreenHandler, other rendering methods
public void drawEndOfLevel()
public void shiftLevelLabels(int shift) // This just adjusts the visibility and location of GImages already on-screen
public void addBackground()

from fruitfever.

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.