Comments (2)
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.
This is essentially complete.
from cs420-project.
Related Issues (20)
- Create Projectile HOT 3
- Rambo Explosion and Transformation HOT 4
- Updated Time Line HOT 1
- Group Meeting for 11/16/2014 HOT 15
- Group Meeting for Week of Nov 17
- Anyone see a way to place new bullets on the game manager? HOT 5
- AI HOT 2
- Bug Testing HOT 2
- TODO Tonight / 20th-21st
- TODO 22nd HOT 6
- TODO 23rd-24th HOT 5
- When bullet fired whole sprite sheet is displayed, also no movement HOT 16
- Powerups Placed in Level HOT 2
- Status Update HOT 1
- Presentation & Design Doc HOT 1
- Testing On Lab Machine HOT 1
- Final Clean Up HOT 4
- Enemies need shoot sounds HOT 1
- Jaws Not Working! HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cs420-project.