Get the latest Education e-news
 

Go Back   Game Career Guide Forums > Programming
Forum Home Register Members List Mark Forums Read

Closed Thread
 
Thread Tools Display Modes
Old 11-13-2008, 07:37 AM   #41
Duckman
Member

Activity Longevity
0/20 17/20
Today Posts
0/11 sssssss84
Location: Tuckahoe, NY
Thumbs up

Quote:
Originally Posted by Claxon View Post
Is your draw() function being called repeatedly? It sound like either draw is only being called once or your x & y positions are not being updated. For the second problem, this could be a pass by reference / pass by value issue depending on how you've done your code. So your update function may be updating a copy of your paddle's position rather than the actual one your draw method is using. If this is the case you could make sure your x / y coordinates are in a global variable, and have your functions edit that, instead of passing the x & y coordinates into other functions as parameters. (I hope I've made that understandable.

If you like you can post the code for your paint & processing functions, so we can help locate the problem.
Unfortunately, I am at work and my code is at home so I cannot get it to you until tonight. Anyways I will try and explain it as best as I can. My graphics and windows programming in C++ is very poor being the only C++ programming I ever did was console. I was doing my drawing in the WM_PAINT case within the WindowsProcess function. Let me try and give you a general summary.
Code:
case WM_PAINT:
{
hdc = BeginPaint(hWnd, &ps)

HDC memDC = CreateCompatibleDC ( hdc );
HBITMAP oldBM = (HBITMAP)SelectObject(hdc, paddle_BMP);

BitBlt(hdc, player1.x, player2.y, paddle_BMP.width, paddle_BMP.height, memDC, 0, 0, NULL);

SelectObject(memDC, oldBM);

DelectObject(memDC);
}

Now the syntax of this is probably not correct, but I hope you get the general idea of what I am trying to do. This is called the first time and the x and y values are set prior to this. Now in my game loop I basically call the WindowProcess for painting every time. If there is user input to the keyboard it will change the values in the paddle struct, which player1 and player2 are.
So it is coming back to this point with the correct values but there are no changes on the screen. It just paints the original paddle and that's it. I was working on trying to make the code organized, but in the end I was just trying to get it to work and lost good programming practices . Hopefully, this gives you a better idea of what I was trying to do.
__________________
Mike M
Facebook Profile LinkedIn Profile
Duckman is offline  
Old 11-13-2008, 02:20 PM   #42
Claxon
Senior Member

Activity Longevity
0/20 17/20
Today Posts
0/11 ssssss345
Location: London
Default

ok it's been a long time since I've done drawing using msgproc events, but if I recall correctly WM_PAINT is only passed when something happens to the window to make windows redraw it eg. Being moved or resized. So you need to tell your program to update it from your game loop. I think the function to do this is called RedrawWindow(). Look it up on MSDN.
Claxon is offline  
Old 11-14-2008, 09:49 AM   #43
Protector one
Moderator

Activity Longevity
2/20 17/20
Today Posts
1/11 ssssss684
Location: Netherlands
Default

Alright, my Pong is pretty much finished. I just need to record the last two sound effects which I forgot, and then it's ready to roll. Hopefully I can get some quiet time later today, and then I'll put it online. It turned out weird. I hope you like it. :P

Edit - OK! It's done! Well, There are bound to be awkward bugs left, but I feel it is presentable. You can play the game here:

Pongtrix

I would like you to play it yourself to find out what my twist is. If you can't be bothered, highlight the section below.
Some notes: you control it using the arrow keys, and you can mute it with the 's' key. The goal is to get either score counter to 10, but make sure the difference between the two scores never exceeds 3! Hard mode is more an experimental mode—I'm not sure if it is even possible to finish it on hard mode (I certainly haven't ). The end screen is the same as in easy mode though, so completionists don't need to worry...
Any comments are welcome!

<spoiler>
It's a Pong/Tetris/Breakout mashup! You control the Tetris blocks, which disappear when hit in easy mode (the 'Breakout'-part). Making lines with the Tetris blocks doesn't make them disappear, so you have to manage your blocks carefully (especially in hard mode...)
</spoiler>
__________________
My name is Louis. Hi!
Uh oh! The princess is in another signature!

Last edited by Protector one : 11-16-2008 at 06:17 AM. Reason: Added awesomeness.
Protector one is offline  
Old 11-14-2008, 04:11 PM   #44
FourEyes
Junior Member

Activity Longevity
0/20 16/20
Today Posts
0/11 ssssssss1
Default

the pongtris was fun and a bit strange to play.

Wish I had time to make an entry but got to much other (school related) stuff to do atm.
FourEyes is offline  
Old 11-14-2008, 04:24 PM   #45
apatriarca
Member

Activity Longevity
0/20 17/20
Today Posts
0/11 sssssss42
Location: Turin, Italy
Default

I have seen this challenge only today!!! I hope to be able to partecipate in future challenges...
apatriarca is offline  
Old 11-15-2008, 03:42 AM   #46
Claxon
Senior Member

Activity Longevity
0/20 17/20
Today Posts
0/11 ssssss345
Location: London
Default Judges & Submission

I've been working on a website where people can upload their entries, but it's not ready right now (and I've got a busy day ahead), so if you want to submit your entry either upload it to your own webspace & post the link here (I'll edit the first post with all of the entries), or you can PM me & I'll give you an e-mail address to send the files to, which will then be uploaded onto a web server.

The Judges for this competition will be dmcclure, Gshonk and TG1. Judging wont begin until at least tomorrow, so you have until the end of the day to get your entries in (and maybe a little of tomorrow - we have very flexible deadlines in the games industry ).
Claxon is offline  
Old 11-15-2008, 09:18 AM   #47
akilbandele
Member

Activity Longevity
0/20 16/20
Today Posts
0/11 sssssss51
Location: Atlanta, GA
Default

Freakin awesome pong man. it was quite strange but fun at the same time. keep it up man!
__________________
The only Verdict is Vengence a Vendetta, held as a Votive not in Vain, for the Value and Veracity of such shall one day Vindicate the Vigilant and the Virtuous.
akilbandele is offline  
Old 11-15-2008, 04:45 PM   #48
Claxon
Senior Member

Activity Longevity
0/20 17/20
Today Posts
0/11 ssssss345
Location: London
Default

Well it's not got everything I'd hoped to fit in, but it's fairly playable.

http://www.secondconflict.com/GPC/data/PongBlast.zip

The game will work with one or two players sharing a keyboard (although if you have a wired xbox 360 controller, that should work too). It was build using the XNA3.0 framework so you may need to download & install that to run it.
Claxon is offline  
Old 11-16-2008, 12:09 AM   #49
Claxon
Senior Member

Activity Longevity
0/20 17/20
Today Posts
0/11 ssssss345
Location: London
Default

why is it that whenever you upload and post about a file, you always discover something wrong with it? (or in my case 3 things wrong with it) I've just updated my zip now.
Claxon is offline  
Old 11-16-2008, 11:22 AM   #50
Gshonk
Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss831
Location: Philadelphia, PA
Default

Are there only 3 entries? Claxon's, martin.bilello's, and Protector one's?
__________________
Grant Shonkwiler()
"I would love to fix the world if someone would just give me the source code"
Website Industry blog LinkedIn
Gshonk is offline  
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
All times are GMT -8. The time now is 10:46 PM.






UBM Tech