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 / DarkGDK Coding Challenges

Author
Message
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 19th May 2009 16:16
The DBP and DBC boards both have challenge threads so why not DGDK

First the rules, I'm not going to re-invent the wheel so I've borrowed heavily from the DBP rules. (All credit to the original creators of course.)

Here are the 10 challenge rules:

1. Anybody may enter any challenge, as many times as they like, so long as all code is written with DarkGDK.

2. No external media is allowed

3. The person who wins the current challenge becomes the next challenge setter.

4. The challenge setter is the judge for the current challenge, and must select a winner and a runner up.

5. The challenge setter may enter, but may not judge him/herself the winner.

6. The challenge setter will set the time limit according to difficulty. The challenge setter may extend the deadline by 24 hours if there is a very good reason, but extensions must not be made during the final 24 hours of the challenge.

7. If nobody enters within the time limit, the challenge setter must set a new challenge.

8. If the challenge setter fails to judge entries or set a new challenge within 24 hours of the deadline, responsibility for judging and setting a new challenge will pass to the previous runner up. If that person also fails to act promptly, entrants may vote for a winner and new challenge.

9. You may use code from any other entries within the challenges thread for your current entry, so long as you improve upon it in some way and give credit.

10. All entries are due by 12:00am GMT of the deadline



First Challenge: Pong

Create a 2d or 3d version of pong. Bonus points given for working AI.

Deadline: May 31st

Good luck and have fun!



Image thanks goes to AndrewT
Wayne C
15
Years of Service
User Offline
Joined: 9th May 2009
Location: UK
Posted: 19th May 2009 18:56
Wohoo a programming challenge. Doh it's only 12 days away

In that time I have to:
- Run a business.
- Paint two more rooms in the house.
- Hope the Mrs doesn't give birth early to our 4th child.

ps. My posts are still moderated (so can whichever mod is reading this unblock me, I was 1st registered over 5 years ago but due to old age and loss of hair leading to a poor memory I had to re-subscribe) ...pretty please

(Previously known as Deepblue).
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 19th May 2009 23:33
I'm beginning work on my entry (even though I can't win) and I've hit to stumbling blocks... firstly, I have no clue if the commands I'm using do anything...with DBP they changed color and all of the native C++ commands change, is there a way to make the DGDK commands change color?

secondly: every time I try to run a project made with DGDK I get the following error




Any help appreciated



Image thanks goes to AndrewT
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 20th May 2009 01:48
I think it needs to be just "d3d9.h".

------------------------------------
Currently 1500+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 20th May 2009 02:46
accept there is no include statement at all...its just there anyways...



Image thanks goes to AndrewT
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 21st May 2009 00:38
Can you define what you mean by "no outside media?" Are you talking about no images? No third party add-ins?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 21st May 2009 02:35
Arrowh:

You have the DirectX SDK installed and you've set up your directories in MSCV++ Express, correct?

i like orange
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 21st May 2009 02:37
go here http://www.andromedus.com/dbp/html/media-rule.html, its explained there.



Image thanks goes to AndrewT
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 23rd May 2009 13:17
Hi Everyone!

So it's time for first entry, here we go.

Game features:
1 or 2 player mode
Amazing A. I.
Cool graphic
Ball speeds up every 5 second
Player/CPU shrinks every hit
CRAZY BALL ®©™ feature: every 5 second ball is going craaaazy (setting random angle), indicated by ball color (from white to red)
Realistic bounce 2d effect
No sound (couldn't get it work)

Game Controls:
Player 1: Left & Right arrow keys
Player 2: A & D keys
Start/Chose in menu: Enter
Go back to menu: Esc



Enjoy!!!
Hope you will like it!!!

Attachments

Login to view attachments
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 26th May 2009 04:34 Edited at: 26th May 2009 04:35
I really like it, good job. The Crazy Ball gets really annoying sometimes. The function ShowScores() makes the game lag a lot. Mainly because of calling dbCenterText().
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 26th May 2009 12:30
Hi, I didn't notice any lags in it, but anyway here is corrected version of that function. Also dbSetTextSize is called only once now. (not tested, wrote it at work, i don't have c++/dark in there).

aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 26th May 2009 21:23
@ AndrewT: I'm pretty sure I do...



Image thanks goes to AndrewT
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 26th May 2009 21:37
Really cool! The CRAZY BALL feature really makes it interesting! (but me angry )

#ifdef _DEBUG
FixBugs(All);
#endif
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 26th May 2009 22:26
I took a brief look yesterday. It has some nice features. I'm still plodding along on mine. I started out simply then decided to change to using classes, as I should have done from the start. But I have a tendency to try to put too much of the functionality in the classes in order to simplify the logic at the main level. And some of those are merely to satisfy a functionality that's called only under very specific circumstances.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 26th May 2009 23:20
Could a mod sticky this? Or is that not needed?



Image thanks goes to AndrewT
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 27th May 2009 03:03
I'll second your motion for a stickey =P

I <3 C++ & Dark GDK 4 2 maek mai gamezorz! =D
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 27th May 2009 03:40 Edited at: 27th May 2009 03:42
EDIT: NVM
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 30th May 2009 05:46 Edited at: 30th May 2009 05:51
Okay, I figured that ready or not I need to release this as is. I have some ideas for added features that I'll probably release outside the challenge.

This version of Pong is only a one player game, mostly because I use the mouse for input and can't quite figure out how to use two meeces and mouse vs. keyboard puts someone at a disadvantage. Maybe the next version will will include joystick input.

AAR, I'm including some background notes on the program itself in this post. Hopefully the code is documented enough to explain what isn't in the notes. One thing to note is that this program requires two additional header files that contain somewhat large arrays. Here's hoping they aren't too large.

main.cpp



balldata.h




paddle.h



Notes:



Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Attachments

Login to view attachments
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 30th May 2009 15:14
Very good job! But I thing according to rules:
"You may use your skill to write code which creates it’s own media. By using, for example, the 2-d drawing commands and the ‘get image’ command, you can easily produce textures for sprites and objects. Or by using the memblock commands, you could write a program which creates it’s own sounds."
and
"You may create pictures within Dbpro, and have your code save them as picture files, and load them back again (to be used as an advanced terrain texture, for example), so long as your code does all this with one single execution."
and
"You may use data statements in your code to assist in the creation of media, so long as it is data you have produced yourself, rather than copied/converted from existing media files."

You will have to proof somehow how you created ball/paddle pictures (pixels arrays), but not me to judge. Anyway, well done!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 30th May 2009 17:52
That'll teach me to skim the rules instead of reading them. In my defense, I did use DGCK as the file converter. I used my own Image class which is predicated on DGDK. I probably could have moved my image to a bitmap or memblock and written out the array. Instead the class has access to the pixel data in the image itself using DX calls. The only thing not GDK or DX about it was the file write, which used an ofstream object. It made the formatting a lot easier.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 30th May 2009 21:02 Edited at: 30th May 2009 21:36
So question is what is the limit size of array with data? If i will create simple image editor and include it's code in entry and that editor will create for me an array for example like that:



Am I allowed to use it?
Obviously array will be much much larger e.g. picture size 32x32px will be an array with 1024 elements(32 times 32). Are there any limits?
aarrowh
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location:
Posted: 1st Jun 2009 00:13
Winner time!! sorry I'm late, been a little under the weather for a while. All very good entries, but one has to win.






Image thanks goes to AndrewT
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 1st Jun 2009 13:36
Wow! I didn't expect to win, great! I had to say congrats for Lilith, you have really good programming skills. So I won't be loosing your time and next challenge is:



PS. I'm on holiday from today till 8th of June so I won't be looking at entries during that time (unless I will have I-net access there). Before 14th I will try to post something, as an example even if I know I can't win .

PS2. We need to agree what are the limits of storing data inside code (like I posted above and like Lilith did).
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 3rd Jun 2009 22:42
I've started mine, hopefully I'll manage to finish.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 8th Jun 2009 08:43 Edited at: 8th Jun 2009 08:43
I'm working on a little game to submit to this challenge. Bumping this thread in the hope of getting more people interested in the challenge.
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 8th Jun 2009 11:56
Now for the real test, WILL the previous winner show up to judge

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 8th Jun 2009 15:12
I've got one in the works but I took the weekend off from coding to take care of my poor, suffering lawn.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 8th Jun 2009 22:54
Hi Guys/Girls! I'm back from my holiday so ready to judge!
I will try post something myself before Sunday.
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 9th Jun 2009 02:08
I might be able to get mine done by the end of the week.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 9th Jun 2009 03:47
Mine's pretty much near completion but now it comes down to tweaking the numbers so it's more playable. It's kind of strange how random numbers can behave. I have to make some of the randomness not so random.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 10th Jun 2009 20:26
I'll do this in two parts due to my comentary being a bit longish. My next post will have the code.

Quote: "
Robots

This game is based on an old Unix game of the same name. More information can be found at http://en.wikipedia.org/wiki/Robots_(computer_game) .

The basic play is that you control a human who’s trying to escape from robots by moving one square at a time on a grid. As you move with each turn the robots move one square in your direction. Robots can destroy themselves by running into each other. But if they run into you, you’re dead and the game is over.

In the original game all components were placed at random. In this version the human is always placed near the center of the grid while the robots are placed further out but in otherwise random locations. In the previous version the human had a random teleport capability that was sometimes limited and could also cause you to teleport on or next to a robot. Teleporting is not a feature here. However, the game does provide some help for the human.

Blocks, a squarish object in the game, act as barriers to the robots and human. But whereas the human has the intellect, one would hope, to move around an obstacle, robots will keep trying to occupy a square with a block in it if that square would bring it closer to the human. But until the human moves to a position that opens the path from the robot it will simply stay pressed up against the block.

Electrodes are circular elements of the game. Running into them is deadly for robots. Since robots are sturdier than humans that means that a human would expire much more quickly.

The human moves by using the mouse to click any adjacent square. He can also stand still by clicking the square he currently stands on. Robots move after the human has so the human can possibly cause a robot to move into or towards a block or electrode by moving to a strategic square.

Your goal is not to destroy all the robots but to survive as long as you can. Off where you can’t see it (security so you can’t destroy it) is a robot factory. Initially it introduces a new robot to the grid every three moves at a random location. As (if) you manage to survive long enough it will start introducing new ‘bots every two moves and then every turn.

Under the Hood

If I’d taken a bit more time to work on this I probably would have done some things differently. I would have developed a base class for all the other classes except the Grid. Each would have contained the component’s position on the grid and a few other things to track its needs. Each would have a pure virtual Update function to account for its movements.

I’m not sure what the experts believe but I don’t like the idea of a class knowing about a specific object of another class unless it’s embedded in the class itself, a “has a” relationship. The problem I have with this program is that the Robot, Block and Electrode classes need to know something about the Grid object. That’s why I included the Bind( Grid *) function . This allows the other three classes to know about the dimensions of the grid. All the function does is accept the address of the grid object being passed to it and storing it in a static member for all the objects of those classes to access.

Robot, Block and Electrode classes depend heavily on static data. For demonstration purposes I’ll refer to the Robot class but much of it extends to the other two.

Although it’s possible to declare individual Robots as in

Robot robby;

None of the functions in the Robot class will act individually on this object. The Robot class has a vector stored in it called robotVec that’s declared like this

std::vector <Robot> robotVec;

When a Robot is created a copy of it is pushed on the end of this vector. Operations to update all the robots are done with a call to the static function Robot::Update(). This function initiates a loop that goes through each of the objects in it and updates the position of the Robot object based on the location of the human. It also tests to see if the robot is alive before proceeding.

I’ve also included an iterator for the vector as a static member in order to avoid having to re-declare its rather lengthy definition every time it’s needed.

AAR, the best way to create a new ‘bot that’s managed by the Robot class is to call Robot::GenBot(). This adds a new randomly placed robot into the vector.

A bit of finagling had to be done to keep the robots from initially being generated too close to the human at the center of the screen in order to give him something of a chance to seek cover. More finagling had to be worked into the code in order to bring the electrodes and blocks a little closer to the center.

There are some things that could have been done better. Since robots can be killed it would be possible to re-use the slot in robotVec where a dead one had previously been. However, for this project that would have complicated the code more than I was willing to dedicate to the cause. Because of this the vector will grow larger by one element every time a robot is generated. Executing Robot::Clear() will clean up all the sprites that are assigned and empty out robotVec.

There was also a problem with destructors. Normally I would have had the destructor take care of deleting the sprite. However, since a temporary copy of the robot was created in order to be pushed/copied to the vector it would go out of scope immediately after the copy and delete the sprite number.

A secondary consideration led to some inconsistent handling and inconsistent code. In that it was necessary in some places to pass back both x and y values to the calling code I created the coords structure which encapsulates both x and y values. Ideally I’d use the same for storing the data in the class itself as that would make it easier to grab the data too. I’m just not in a position to go back and re-write the code and still produce a (semi-) finished product within the time I have. I only provided the comparative overloaded operator whereas the coords structure would normally be developed to include the arithmetic operations.

I took pains to make sure that robots plopped on top of a human and I made sure that some things didn’t occupy the same square as another. However, I didn’t make sure that an electrode and a block can’t occupy the same space. Eventually I will but for the moment time constraints are pressing.

Potential Improvements

Time considerations regarding other, neglected projects prevent me from working on other improvements to the game so it will be posted in its current state. I’ve considered doing something like a teleport but make it a rabbit hole that the human can step into in order to come up in another predetermined square on the board. The rabbit hole would then collapse, perhaps to turn up elsewhere later or after the player has attained a certain goal.

Another possibility would be a limited supply of land mines the human could carry. Clicking the right mouse button would drop it where the human was standing. Stepping out of the square would activate the mine and any robot stepping into that square would be destroyed. Perhaps randomly placed mines could be picked up and moved by the human in order to form a strategic defense.

Better graphics would certainly be in order and a bit of animation could improve the look. Instead of just jumping into a square a slow move into it would be less jolting and allow you to follow and anticipate the action.. How about some sizzling sound when a ‘bot hits an electrode or clunk when one bumps into a block. A scream when the human is killed?

"


Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 10th Jun 2009 20:27 Edited at: 10th Jun 2009 20:29
And, here's the code with the executable attached.



Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 12th Jun 2009 22:13 Edited at: 21st Jun 2009 12:12
Here is my entry to this coding challenge: a dice poker game. The attached package contains a "readme" file which explains the rules of the game, the source code and the executable.

***EDIT: See a slightly corrected program a few posts down from here.

Attachments

Login to view attachments
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 15th Jun 2009 18:14 Edited at: 15th Jun 2009 18:15
Time for winners! Both entries where very good, but as we know "in the end, there can be only one."
I've judge it that way:
Gameplay - 0-10 pts
Graphic - 0-10 pts
Sounds/Music - 0-10 pts
Bonus for 2 player mode (co-op/against) 0-10 pts

Because I said that Game play will be the most important so I multiply these points by 2. Every one could get maximum 50 points.

And the WINNER is:

CONGRATULATIONS!!!

Scores summary:


Thanks for all entries, I hope that next time will be more

Now winner time to set next challenge!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 15th Jun 2009 18:59 Edited at: 15th Jun 2009 19:01
I'd like to thank all the people who made this award possible. My producer, my director, my makeup artist... simply everyone.

Okay, this next one should be relatively simple.

Hangman

The player is presented with a series of empty spaces/boxes/underscores that represent letters. Minimum of six letters, maximum of ten. The words will be randomly selected from a list of no less than thirty. The list is provided by the programmer and may be expandable. (Yes, I realize that the list will be visible to the player who has access to the source code. Under normal circumstances it wouldn't be.)

The player is induced to enter a letter at a time. If an entered letter is in the word, all spaces where the letter occurs are filled in. If the letter is not part of the mystery word a body part is added until the last part is placed at which point the player loses. In order, the body parts are

Head
Body
Arm
Arm (other)
Leg
Leg (other)

Appropriate consolation or congratulations should then appear along with an option to play another round.

Along with the player should be a representation of the gallows with platform and the noose. If this is a bit disturbing to your sensibilities some other representation that conveys the same game play is allowed as long as the number of allowed guesses remains the same.

Consideration is given for cleverness in animation, if any. 2D or 3D is kewlsome.

I'm going to allow a bit more time on this than the last one due to my own schedule. So you have until July 3rd. I'll make my judgement on July 4th since I'm going out of town on the 5th.

Good luck to all.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 15th Jun 2009 20:26 Edited at: 15th Jun 2009 20:28
Congratulations, Lilith! Although I didn't post about it, I did try your game and appreciate the work that has been put into it. I think my best result was 11 turns, that's probably not so good. Strategic games are not my strong side.

Interesting challenge, I might try this one too. Thanks for the long deadline. It would be good to have more entries this time.

Thanks to Krisacz for the detailed points!
KeiNagase
15
Years of Service
User Offline
Joined: 15th Jun 2009
Location:
Posted: 16th Jun 2009 06:29
Very fun game. I got 106 turns on it.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 21st Jun 2009 12:16 Edited at: 5th Jul 2009 20:40
I make this post to correct a memory leak in the program that I submitted to the previous challenge. Recently in another thread, Michael P. enlightened me that calling char* functions in Dark GDK several times without deleting the returned string causes a memory leak. Unfortunately I didn't pay attention to that and used the dbStr() function several times in the loop in the dice poker game. Since I don't want people to learn from code which has a memory leak, here is a corrected program, in case anyone is interested.

My entry to the current Hangman challenge will be posted later. It is taking shape nicely. (It uses a char* function too, that's why I returned to this problem.)

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 26th Jun 2009 08:58
Here is my Hangman program for this challenge, with a simple 3D animation.

Attachments

Login to view attachments
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 26th Jun 2009 16:56
Excellent. I hope this compells others to step up to the plate. You have another week to get in your entries.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
ScapeSta
15
Years of Service
User Offline
Joined: 28th May 2009
Location:
Posted: 27th Jun 2009 03:32
uhh well since I'm not really good at programming i'll w8 til the next challenge =)!

"A job well done is a well done job."
DeeMIncGaming
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location:
Posted: 1st Jul 2009 09:39
well i wish i had heard of this before...
im gonna try this challenge even tho i have 3 days.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 3rd Jul 2009 02:45
Here's my entry with very simple 2D graphics.



Your_Health = (My_Mood == HAPPY) ? 100 : NULL;

Attachments

Login to view attachments
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 5th Jul 2009 09:04
Sorry for the delay in my response. I thought I'd have more time over the holiday (for those of us in the US) but I had to deal with other people being off-schedule.

AAR, I will have to judge Mireben as the winner of this round, mostly based on the 3D work. But I must comment that Branflakes impressed me with some very clean code, showing how not to try to keep all the code within the main loop. I must also say that the words were certainly more difficult to guess since I didn't peek at the word lists and I applaud Branflakes for using file access for storing the list outside the code, thus making it expandable. I'm not sure if this would disqualify the effort based on the external media rule since the word list could have easily been included in the code. But under the circumstances the question is moot.

Thanks to both contestants who participated. I wish I had a gold trophy to give to both of you but I don't have enough money to afford even one trophy.

So, Mireben, if you'll issue us another challenge. I'm out of town for the next week so I won't be able to get a jump on a new challege for a while.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 5th Jul 2009 11:06
Thank you Lilith! I will imagine the gold trophy on the shelf.

I hope you will like the next challenge, which is:

Make a battleship game! Here is a description of the game if you are not familiar with it: http://en.wikipedia.org/wiki/Battleship_(game)

Preferably, the player should be able to play against the computer so that they both have their own "battlegrids", they both guess, and whoever sinks all ships of the opponent first, wins the game. However, if this is too much, as a minimum requirement you can implement a one-sided game, where only the player guesses or only the computer guesses, until all ships have sunk.

The game can be 2D or 3D.

And the deadline is: 26th of July, so you have three weeks. Happy coding!
sergioIJ
15
Years of Service
User Offline
Joined: 7th Jul 2009
Location:
Posted: 8th Jul 2009 02:55
This is the best thread ever. I'm going to be busy during july but in august I'll jump into the wagon and try to participate in the challenges
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 12th Jul 2009 10:27
Quote: "This is the best thread ever."


Thank you very much! Thanks to aarrowh who started the thread.

There are still two weeks to join in the latest challenge. Unfortunately I can't participate in this one, I'm busy with another project.

It's summer holiday time, which certainly reduces the number of participants, hopefully not to zero? I'll leave on vacation end of July, but I'll still have time to judge this (or set another task if necessary, but let's not give up hope yet).
Papples
17
Years of Service
User Offline
Joined: 19th Jul 2007
Location: Home
Posted: 22nd Jul 2009 18:04 Edited at: 22nd Jul 2009 20:20
Since nobody is contributing, or too busy coding. I'd better set a platform. Its long, inefficient and the A.I is pretty poor. But I couldn't put too much effort into a challenge I wasn't sure others would enter.

So without further ado.

main.h


Main.cpp


I did this in no time at all. There is still time. Go on and whip me up some competition.

EDIT: I just noticed you always win. but thats just because I forgot to change the output string in CheckForWinner(). But you know when you've lost.

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Jul 2009 10:16
Time to announce the result of the challenge!

I'm very happy that we have received at least one entry, and it's a good work. This was not an easy task. I like that you did both sides of the game, that it's possible to place ships graphically with the mouse, and that the code is clean and organized. I changed the "you win" string in the losing part, so I got correct displays in the end.

What could be improved, as you say, is the AI - not only that the selection of the computer is random, but also that ships should not be allowed to touch by their sides when placed on the grid. But that's the really difficult part and a better solution cannot be expected in such a short time. Also, the grid size in pixels seems to be hard-coded and it was quite small on my monitor, a configurable size would be nice. Still, altogether I can only say it's very nicely done.

To answer the question in your source code: a colour is DWORD type. Instead of dbRGB(255,0,3) you can write DWORD(0xFF0003) for example.

I hereby declare Papples as the winner. Thank you for your contribution and please set us a new challenge!
Papples
17
Years of Service
User Offline
Joined: 19th Jul 2007
Location: Home
Posted: 27th Jul 2009 15:55 Edited at: 27th Jul 2009 16:00
I'm flattered by your feedback Mireben and grateful for the advice, I'll definitely be using DWORD types from now on.

In this, the 50th, post (horray. Lets keep it going) I challenge you all to make a top down "Asteroid-style" shooter.

Examples include:
Geometry wars series (Xbox360/PC) http://www.youtube.com/watch?v=AP6TK2xFWZs,
Super StardustHD (PS3) http://www.youtube.com/watch?v=Jhhocl7jf3o,
Echoes (DBPro) http://www.youtube.com/watch?v=Fw0_ueBoOXc&feature=fvw

Notice that they all include a great deal of visual effects to flower up the very simple, repetitive gameplay ( move, shoot and get powerups )

Hopefully the simple gameplay requirements should attract more entries. Both 2d and 3d entries are welcome. However be warned my judging criteria will be a little different:

Special Effects - 60pts max

20pts - explosion related
20pts - weapon related
20pts - other inventive/pretty effects

Gameplay - 10pts max

5pts - enemy variety
5pts - powerups

Graphics - 5pts max

Minimalism is fine and should get you the full five


Total: 75

I guess that makes this a medialess special effects challenge. Be creative and good luck to all!

Deadline: 20th August

Login to post a reply

Server time is: 2024-10-01 14:24:35
Your offset time is: 2024-10-01 14:24:35