Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Bullets and arrays !help!

Author
Message
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 6th Jan 2012 15:18
I don't quite understand that with making a array and use it to make bullets, can anybody please help me with getting me understand it?

Beginner In the Language.
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 6th Jan 2012 15:19
I think this thread can help you out: http://forum.thegamecreators.com/?m=forum_view&t=192871&b=22
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 6th Jan 2012 15:36 Edited at: 6th Jan 2012 15:46
No sorry i want array's.
That was linked links.

Beginner In the Language.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jan 2012 16:25 Edited at: 6th Jan 2012 16:26
I'm not sure what your question is, but here goes.

in your loop:


The fastest code is the code never written.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 6th Jan 2012 17:58
I recommend the lists, its a nice way to make the bullets and thanks to hawkblood my game can continue

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2012 18:58
vitinho your website... why on earth are you using a real player video site?

Would like to learn more about your product... shame cant watch the video... would be better if it was in either Divx or flash... but realplayer... fair enough if it was quicktime... but woah does anybody even use rp anymore? frankly the worst player ever...

On topic...

I would have figured an array with some sort of timer system would have worked but I am srill figuring this ome out myself...

Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 6th Jan 2012 19:56
I did a copy&paste of the code but it give me the errors
Quote: "1>------ Build started: Project: Fighter, Configuration: Debug Win32 ------
1>Compiling...
1>weapon.cpp
1>c:\program files (x86)\microsoft directx sdk (august 2007)\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(18) : error C2065: 'Bullet' : undeclared identifier
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(18) : error C2228: left of '.Active' must have class/struct/union
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(18) : error C2065: 'Bullet' : undeclared identifier
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(18) : error C2228: left of '.Update' must have class/struct/union
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(21) : error C2065: 'Bullet' : undeclared identifier
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(21) : error C2228: left of '.Active' must have class/struct/union
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(28) : error C2065: 'Bullet' : undeclared identifier
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(28) : error C2228: left of '.Active' must have class/struct/union
1>c:\users\\documents\visual studio 2008\projects\fighter\fighter\weapon.cpp(28) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Build log was saved at "file://c:\Users\\Documents\Visual Studio 2008\Projects\Fighter\Fighter\Debug\BuildLog.htm"
1>Fighter - 9 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
"


and my code looks like this


Beginner In the Language.
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 6th Jan 2012 19:58
structure object name is "Bullets" and you are using "Bullet", change one of them to match the other

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jan 2012 20:10
Thanks Hassan.

Sometimes I need a spellcheck.

The fastest code is the code never written.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 6th Jan 2012 21:09
@mrvalentine
what the hell are you talking about? my website is made with php and css and some mysql, i made it..

i dont get where you got real player or that....

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2012 22:36 Edited at: 7th Jan 2012 21:30
Look at your product page...

clearly you have no idea what you did but thats normal I forget some things I put up there... or did you not read me mentioning the word video?

And calm the hell down no need for that tone...

But yeah I like it... you should declare the background to be consistant it white borders but I like how its plain and simple... my design mantra right there!

EDIT

should'
not'

Gotta hate it when you spot a typo just as you press send haha

Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 7th Jan 2012 13:25
Sry can you post code that i should change?

Beginner In the Language.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 7th Jan 2012 17:58
This post gives me hope you developed a company off of one game. I don't work for any one and, I have made a game using the concepts described above for my new game space chips, but this is my first game made for the game creators.

Go through yourself at a wall.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Jan 2012 18:05
For?

3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 7th Jan 2012 18:07
If you look at the agk app game kit group you will see a demo for my game.

Go through yourself at a wall.
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 7th Jan 2012 19:16
Quote: "Look at your product page...

clearly you have no idea what you did but thats normal I forget some things I put up there... or did you net read me mentioning the word video?"

I don't even see a video on his site. What site are you going to?
And by product, do you mean the Games page?

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Jan 2012 21:30
Well if a game is not a product I have no idea what it is...

But yeah when you click view video... eitherway not bothered about it now if everyones going to have a dim view on constructive criticism...

No idea...

Argh another typo to fix...

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 8th Jan 2012 01:42
@mrvalentine
dude sorry to be rude ..
But are you talking about the ads? That's not my fault if they are in real player or something..

And thanks for saying the page is simple and clean.. i think its not bad.. but i dont want to lose much time on it since im working hard in a browser based game to release it on March 23rd

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Jan 2012 03:53
Went to have a look again and finally figured it out... why is your site so buggy? or did you put all the ad generating code?

I think someone here owes me an apology... sorry mate but why would you put so much cac on your site... you will just drive away potential customers... or is it a free host? I dont get it...

I went to your site just now clicked on games and it created a new window and ... that explains everything youve bugged all the links...

Why¿

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 8th Jan 2012 04:24
Oh I see what you mean MrValentine. I use AdBlock for Chrome, so I didn't get the ads. Sorry for jumping down your throat.

Vitinho, if you could at least get rid of the Flash-based ads(you should be able to tell your ad provider to do that) your site's performance would quite dramatically increase. Without the flash ads it's very quick and responsive but with the ads it's very slow and sluggish.

Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 8th Jan 2012 10:43 Edited at: 8th Jan 2012 10:44
This is off Thread.

Beginner In the Language.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 8th Jan 2012 12:19
@blackout
Sorry dude :S

@DAR13
I will do that thanks

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Jan 2012 15:03
@Blackout1471
Did you get what you needed?

The fastest code is the code never written.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Jan 2012 15:54
Pretty sure the feedback was conclusive...

Lists
Arrays

Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 8th Jan 2012 16:40 Edited at: 8th Jan 2012 17:06
Yes thanks i now understand it.

Thanks to all.

Beginner In the Language.
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 9th Jan 2012 16:19
Ohh i got one more question? About Collision

how can i add collision so that if the current bullet hits enemy then it deletesprite?

Beginner In the Language.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 9th Jan 2012 20:10
Do a distance comparison:
assume bx,by is bullet and tx,ty is target
int dx=dbABS(bx-tx);
int dy=dbABS(by-ty);
if ((dx<5)&&(dy<5)){//hit
//do whatever code you want to cause your target to die/get hurt or just disappear
}

The fastest code is the code never written.
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 10th Jan 2012 15:03
int hit_I'd=dbSpriteCollision(bullet_id, 0);
if (hit_I'd>0)
{
// bullet hit something; handle it here...
// hit_id contains the id of what was hit...
}

JTK
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Jan 2012 23:30
@JTK
The method you described requires that the program use sprites for bullets. Although this is not in the least an issue, I wouldn't use that many sprites on the screen.... Unless you use dbPasteSprite(..), but that would not work with your code anyway.

@Blackout1471
Using multiple sprites as JTK's code would need is a viable solution, but you will need to decide early on how you want to do it. No matter what you use, it will work just fine.

The fastest code is the code never written.
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 11th Jan 2012 08:50
But i can't get the code
Quote: "Do a distance comparison:
assume bx,by is bullet and tx,ty is target
int dx=dbABS(bx-tx);
int dy=dbABS(by-ty);
if ((dx<5)&&(dy<5)){//hit
//do whatever code you want to cause your target to die/get hurt or just disappear
}"


to work, and what is dbABS can't find it in docu.

Beginner In the Language.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 11th Jan 2012 14:59
Quote: "dbABS can't find it in docu"

Not at home right now, but it should be in the math section (maybe core). I'm not even sure that it's the right command, but whatever is the "absolute value" command is what I am refering to.... It's there somewhere.

You can't just copy and paste the code I gave you because the "assume bx,by is bullet and tx,ty is target" part is something you will have to write. Change the variables to whatever you have in your game for the position of the bullet and position of the target. In "if ((dx<5)&&(dy<5)){//hit" part the value of 5 is an arbitrary number I made. Make it whatever you want because it's the "size" of the target.

The fastest code is the code never written.
Blackout1471
12
Years of Service
User Offline
Joined: 21st Dec 2011
Location: Visual C++ Express
Posted: 11th Jan 2012 15:39
Thanks Hawkblood

Beginner In the Language.

Login to post a reply

Server time is: 2024-04-23 07:45:18
Your offset time is: 2024-04-23 07:45:18