Code Monkey home page Code Monkey logo

Comments (2)

jhawz avatar jhawz commented on August 16, 2024

Wanted this information in this issue...

@Jagabel commented 5 days ago
Controls were put into the Bond class to drive his actions, just like AI
will be added to the enemy.

Projectiles do not belong in the Game class. The game class exists only to
flip between game modes and drive other objects into action. If you want to
test your stuff in the Game class to make sure it works, that's entirely
fine. But ultimately the projectiles will need to be added to the
GameObjectManager so that they can be drawn and moved properly. Not to
mention that the GameObjectManager already has an internal list of all
VisibleGameObjects to loop through to check against objects.

My recommendation would be to go to the update loop of the
GameObjectManager and toss in an if statement to check if the current
object the iterative points at is a projectile; if so, have it run through
another sub to check for collisions between the projectile and the actors
on the map. Also we can adapt the already existing collision code to "kill"
the projectile if it hits a tile, so in the second loop you'd only need to
check for collisions against bond/enemies.

I have an int called type set up for VisibleGameObject; it defaults to 0
for Tile,1 for Bond and 2 for Enemy. You can use that to limit what the
loop looks at for collisions.

I say all that without thinking about the original question -_-. So if projectiles are being created due to the fire button being pressed...then that is an issue if the control is in the Bond class. The best bet then would be to pull the controls out of Bond and put them into Game, because then at least the fire button can return the created projectile for it to be added to the GameObjectManager.

from cs420-project.

jhawz avatar jhawz commented on August 16, 2024

This is essentially complete.

from cs420-project.

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.