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.

DarkBASIC Professional Discussion / Stacker game - urgent code help needed

Author
Message
greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 22nd Sep 2010 06:35
Hi guys,

I am programming a direct copy of the arcade game \"Stacker\" http://www.youtube.com/watch?v=mG4TM4L81eU, but am coming up against a few problems.

I have the blocks moving, leveling up when you press spacebar, and some other simple things like that, but I am having a really hard time checking to make sure the current blocks are over the old blocks.

I don\'t think the code is that complex, but I just can\'t get my head around it.

If someone could point me in the right direction, that would be fantastic. The code is VERY messy, and completely hacked together. I\'ve been bashing my head against this one problem for a day now, and it\'s not getting any easier. Also, I am on a rather tight deadline for this, so if anyone can help, I\'d really appreciate it sooner rather than later

The code is attached at the bottom here, and should run fine in DBPro. I am using IanM\'s Alarm functions, and someone else\'s key-press function. I can\'t remember who wrote it though.

I can\'t offer any money payment, but maybe if you need some concept art done, I could help? I do a lot of environmental stuff, so if anyone needs a concept image, and can help, maybe we can sort something out.

Cheers,
Greenlig



Your signature has been erased by a mod as it is far too big.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 22nd Sep 2010 08:37
Store the positions of the blocks in a grid like array so you can easily and fast check if one is above the other.
greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 22nd Sep 2010 08:39
Cheers for the reply Quel. I have been doing that, but I don't think my method is that good. It certainly isn't working the way I would like it to.

Greenlig

Your signature has been erased by a mod as it is far too big.
greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 23rd Sep 2010 01:19
No one can have a look at the code?

Greenlig

Your signature has been erased by a mod as it is far too big.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Sep 2010 04:52
Quote: "No one can have a look at the code?"


It's because Quel has already answered right. You are storing them in an array but a UDT. Quel meant a regular 2D array so you can see the data you want real easy. Most of the time you'll want to make it easy on yourself and use the 2D grid array to position the player and to draw all the graphics.

Now I didn't write the following code so you could scrap all that you've done and use mine instead... especially if you saying "Also, I am on a rather tight deadline for this, so if anyone can help." means that this is for a class project. Learn from my code and modify your own code.



greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 23rd Sep 2010 08:03
Thanks Grog. This isn't for a class project, it's for a work related project, hence the deadline.

I am pretty poor at programming, and almost always code things the wrong way. I am following the code you posted, and will be modifying mine to act in a similar way.

Cheers for the help, and sorry if I seemed pushy.

Regards,
Greenlig

Your signature has been erased by a mod as it is far too big.

Login to post a reply

Server time is: 2026-07-22 12:41:48
Your offset time is: 2026-07-22 12:41:48