Need Examples
Need Examples
Im currently working on my own game, and im just curious on how to make something. Lets say the game character starts with no weapon and as the game progresses the character collects a weapon off of the map. How would i go about setting the character so when he moves over the weapon, the said weapon is collected and then setting kbd functions for aiming and shooting. I dont have my own code to post yet for some feed back on where im effin up, but i will post something soon. So if anybody has any ideas the help would be much appreciated!!
What you call a bug...I call a new feature!
Re: Need Examples
Check out my shooting game : -)
At the bottom of this page Link there's the full project download. It doesn't have weapon picking but it's got ammo picking and different weapons, etc.
At the bottom of this page Link there's the full project download. It doesn't have weapon picking but it's got ammo picking and different weapons, etc.
ʕ •ᴥ•ʔ
Re: Need Examples
There is something else i was needing help w/ (well there are actually a lot of things but that is besides the point), is there a way to put a timer on a function? im going to give an example without posting a lot of code. i am modding chili's poo game(the one where you collect the yellow disc as a goal), and I've added a "shield". When you pick up the "shield" it activates a blue circle around the smiley face. How can make it to where after the "shield" is drawn it will only stay drawn for a set amount of time. Also what would I need to do to make it to when the poo comes into contact with the "shield" the poo is destroyed(disappears or anything to that nature). I know how to detect for poo/shield collision but once collision is detected i dont know how to destroy the evil evil poo. If you want me to post my code so far just let me know but im hoping this short explantion will suffice.
What you call a bug...I call a new feature!
Re: Need Examples
What you want to do here is pretty simple. I'm sure you'll figure it out yourself.
Chili hasn't taught much about timers yet, so here's how a simple timer would look like, using the one from Timer:
For this to work you need to include "Timer.h" and make a timer object, in this case called simply "timer". There is prolly a better way, but this is how I did it...
Chili hasn't taught much about timers yet, so here's how a simple timer would look like, using the one from Timer:
Code: Select all
if (timer.GetTimeMilli() >= 1000) // Interval: 1000 msec, one second
{
// Do stuff every time the timer "ticks"
timer.StartWatch(); // Reset timer
}
ʕ •ᴥ•ʔ
Re: Need Examples
sweet stuff...really appreciate it lux
What you call a bug...I call a new feature!
Re: Need Examples
it didntz work, i used the #include "Timer.h" in my Game.cpp and when i went to build solution i got errors saying, timer undeclared, StartWatch undeclared identifier....
What you call a bug...I call a new feature!
Re: Need Examples
You need to make a timer object first. Just like you declare an int in Game.h, you need to declare "timer" first. Simply go to Game.h and under user variables, write "Timer timer;" Also make sure you put the include Timer to Game.h.
The code I gave isn't an "actual" timer provided, it's something I threw together to make a fake timer. There's probably a much better way to do a timer, but I think this is good enough for now at least.
The code I gave isn't an "actual" timer provided, it's something I threw together to make a fake timer. There's probably a much better way to do a timer, but I think this is good enough for now at least.
ʕ •ᴥ•ʔ
Re: Need Examples
ok ill try that and if that doesnt work ill post it
What you call a bug...I call a new feature!