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.

Newcomers DBPro Corner / keeping score help

Author
Message
pc nerd
User Banned
Posted: 28th Mar 2009 04:29
ok,so I want to be able to let my guy in game to be able to collect items, after you collect one item you will recive one point.

then the next another point will be added, here is my problem.
I will explain then show my coad and any help would be greatfull.

when i collect one item it dissapers like it should but then my counter keeps couning and wont stop. so instead of collecting just one point i get like 30 or 40 becouse the collition box in still in place, when i go to delete the collition box the item was using in the event then no points are added. i tryed to put the wait inbetween the 2 lines of coad but this did nothing but freeze the game then delete the guy and then still i got like 30 points. so here is the coad and thanks for the help.





the moonbucks#=moonbucks#+1 is where you would recive the points"" moon bucks

dweeb
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Mar 2009 18:19 Edited at: 28th Mar 2009 18:23
i don't know the whole scope of your game but you could add a flag to the collectable items to let the scoring system knows whether or not it should add a point when collision is detected. for this example, let's say you have 30 collectable items:




then, during game play, use your existing code with the following additions: (i don't use sparky's so, the example will use standard DBPro collision)



you get the idea. hope this helps

pc nerd
User Banned
Posted: 28th Mar 2009 19:55
thank you so much, i think this is what i needed, ill try it ou but it sounds and looks promising.

dweeb
pc nerd
User Banned
Posted: 28th Mar 2009 21:30
well i hate to say it but this did not work, all it did was make 30 of my objects and then delete my whole level, i was standing in a blue screen with 30 of my objects and as i turned around it made a mess of objects around me in a blur. also when i did go to collect one of them it did not delete or add any points. wierd,

could someone please give me a easier way or explanation on this for me.

dweeb
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 29th Mar 2009 22:56
Odd... I don't see anything wrong with Virtual Nomad's code. What are you using as your player model? Maybe its collision size is too big or something? Try substituting it for a sphere or cube for testing purposes. Also, are you using "X" somewhere else in your loop? If so try changing where it says "X" in his second code box to "GotItem" or something.

<---Spell casting battle game!
Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 30th Mar 2009 00:00
Well what i do is i paste all my sprites from one sprite thats offscreen and in a for-next statement set the original sprites location equal to its pasted object and check for collisions. if there is one, i move the pasted sprites position offscreen. heres an excerpt from something im working on if that helps:



pc nerd
User Banned
Posted: 30th Mar 2009 05:10
@ Sixty Squares
ok, ill try that and see if it makes a difrence, im using an .x object for the objectim collecting and my player is a .x object also. I dont know for shure if this matters for the abouve coad but I would not think so. thanks for the advice

@ Databug
I am really lost on what sprites have anything to do with my points system? please explain what you mean a little better so i can understand. at this point i fill like a 2 year old,lol.

dweeb

Login to post a reply

Server time is: 2024-11-24 09:54:44
Your offset time is: 2024-11-24 09:54:44