Comments (16)
void GameObjectManager::checkIfActorFired(VisibleGameObject* obj) {
std::cout << obj->getFiring() << std::endl;
if (obj->getFiring() == true) {
Bullet *bullet;
if (obj->isFacingRight()) {
bullet = new Bullet("actors.xml", "textures/JB.png", 0);
bullet->SetPosition(obj->GetPosition().x, obj->GetPosition().y);
bullet->setBoundary(obj->GetPosition().x + 400,
obj->GetPosition().x - 400);
} else {
bullet = new Bullet("actors.xml", "textures/JB.png", 1);
bullet->SetPosition(obj->GetPosition().x, obj->GetPosition().y);
bullet->setBoundary(obj->GetPosition().x + 400,
obj->GetPosition().x - 400);
}
Add("Bullet", bullet);
obj->setFiring(false);
}
}
from cs420-project.
Looks like no texture rect is being set...is there a bullet entry in the
config file?
On Thursday, November 20, 2014, Joe Hause [email protected] wrote:
Code in GameObjectManager
void GameObjectManager::checkIfActorFired(VisibleGameObject* obj) {
std::cout << obj->getFiring() << std::endl;
if (obj->getFiring() == true) {
Bullet *bullet;
if (obj->isFacingRight()) {
bullet = new Bullet("actors.xml", "textures/JB.png", 0);
bullet->SetPosition(obj->GetPosition().x, obj->GetPosition().y);
bullet->setBoundary(obj->GetPosition().x + 400,
obj->GetPosition().x - 400);
} else {
bullet = new Bullet("actors.xml", "textures/JB.png", 1);
bullet->SetPosition(obj->GetPosition().x, obj->GetPosition().y);
bullet->setBoundary(obj->GetPosition().x + 400, 0);
}Add("Bullet", bullet); obj->setFiring(false);
}
}
—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
Yes there is a Bullet entry. There is a set texture rect in there. For some reason the Update function on Bullet is not getting called once the bullet has been placed in the game manager. I'm looking at it now. Thanks for checking it out man 👍
from cs420-project.
Ok, now I don't think that is the problem anymore. Not sure what is causing this...
from cs420-project.
@freegyp did you actually test that the bullet gets drawn properly and fires properly?
from cs420-project.
Got it. In the constructor for the Bullet class add in this line:
type = 4;
Let me know if that works.
On Friday, November 21, 2014, Joe Hause [email protected] wrote:
Ok, now I don't think that is the problem anymore. Not sure what is
causing this...—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
The full sheet moves forward and then disappears so that is something different.
from cs420-project.
Hm...my code shouldn't cause it to disappear or pop up as an entire
sheet...is there a death method or something similar being triggered?
On Friday, November 21, 2014, Joe Hause [email protected] wrote:
The full sheet moves forward and then disappears so that is something
different.—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
This piece of code in Bullet.cpp was killing it. With that commented out, the whole sheet appears for a second and then disapears leaving the bullet to go accross the screen.
if (pos.x+vx*elapsedTime<=leftBoundary||pos.x+vx*elapsedTime>=rightBoundary) {
animReq("disappear");
to_delete=true;
}
from cs420-project.
I set the boundary in the checkIfActorFired function in GameObjectManager as (but still does this if boundary is not set):
bullet->setBoundary(obj->GetPosition().x + 400,
obj->GetPosition().x - 400);
from cs420-project.
Still doesn't explain why the whole sheet is getting drawn at first though.
from cs420-project.
The texture rect is modified as result of movement, but not with the
constructor...causes a second or so of the entire sheet being drawn. I had
that issue with the character classes.
A quick fix would be to put the line:
GetSprite().setTextureRect(...) and then fill in with a rectangle from the
sprite sheet.
On Friday, November 21, 2014, Joe Hause [email protected] wrote:
Still doesn't explain why the whole sheet is getting drawn at first though.
—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
My boundary settings were off. Sheet still getting drawn. Put that in the Bullet.cpp? You did that with bond and enemy?
from cs420-project.
Yeah sorry forgot to add that. Put that into the constructor...I added it
to Actor's constructor to fix the issue for bond/enemy
On Friday, November 21, 2014, Joe Hause [email protected] wrote:
My boundary settings were off. Sheet still getting drawn. Put that in the
Bullet.cpp? You did that with bond and enemy?—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
Awesome, thanks dude
-Joseph Hause
Sent from my Android Device
On Nov 21, 2014 12:32 PM, "Jagabel" [email protected] wrote:
Yeah sorry forgot to add that. Put that into the constructor...I added it
to Actor's constructor to fix the issue for bond/enemyOn Friday, November 21, 2014, Joe Hause [email protected] wrote:
My boundary settings were off. Sheet still getting drawn. Put that in
the
Bullet.cpp? You did that with bond and enemy?—
Reply to this email directly or view it on GitHub
#44 (comment).—
Reply to this email directly or view it on GitHub
#44 (comment).
from cs420-project.
This has been resolved thanks to @Jagabel Bond sometimes slides on the right combination of key presses and the shooting animation stops after 2 frames or so.
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
- Bullet Collisions HOT 2
- 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.