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 / Suggestions and comment on code

Author
Message
MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 3rd Nov 2010 23:23
Ok so I have been attemping to put together a game where you move a airplane up and down the screen to pop balloons moving across the screen but I have had a snag cause when I run it I just get a black screen that wont close....suggestions?

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 4th Nov 2010 11:47
I guess you need a dbSync(); inside the while (LoopGDK()) loop...

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Nov 2010 17:27
How did you get that far with your code without being able run it?

Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 4th Nov 2010 19:22
The only place I could see that you had a dbSync() command was in the intro function, but you dbCLS() right befor so you don't see anything. Then when your in your main loop you never dbSync() so the screen never updates. If you are going to set the Sync Rate you should do it befor you sync(I would think). Also in your Summary function you dbSyncOff()??


I agree with Matty, how did you manage that without actually being able to see/test?

Greg_C
14
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 4th Nov 2010 19:35
Something that I noticed was that you have a summary at the end of the game but that isn't going to work because popped is never getting added on to when you pop a balloon. What you should do is instead of declaring the popped in the void DarkGDK() declare it globally so you can use throughout the functions you made. So then in the collisionDetection() function when a balloon gets popped you just do this:
popped++;

Then in your summary you can just do this:

MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 7th Nov 2010 23:13
I didnt test it cause I basically changed the code I was given to work with assuming that other then the sprites and the directions they were moving would change but for some reason nothing works. Now I have simpified it way down to removing all of the screensummary stuff and basically having just the sprites moving, but I cant get them to move now they just show up on screen but nothing happens.

Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 9th Nov 2010 02:48
Everytime you call your moving balloons function you give them new values. It looks like they should be jumping all over the place right now. You should have your Balloon x and y variables at the top somewhere and assign the initial values there. You also assign the balloon x position to the Sprite's X position which you never set which i think defaults to 0. Your if statement should also be if Balloon x > 0 not < if you are going to be going to be moving them to the 0 position. Your green sprite is also using the red sprites x variable, looks like it should be balloon2x not balloonx.

In your moving airplane function you should be checking if it is > 480 not less then cause right now if you press down it will just put it at 480. It would also seem that you are going backwards with your movement, up will move down and down will move up, don't know if you want your controls inversed like that or not.

Hope that helps a little.

MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 9th Nov 2010 04:06
Ok so I am still lost. I have been through the code at least 100 times today and cant seem to find the issue as to why the sprites wont move. Here is what i have now. I made a render function thinking that would help cause in the example code I was given it uses it but it didnt help. Anyone got any ideas?

MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 9th Nov 2010 04:27
Ok well finally came up with an idea that worked everything moves but now instead of moving the airplane sprite, I move the yellow balloon sprite. I dont think I mixed anything up but then again maybe. Any ideas?

MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 9th Nov 2010 04:33
nevermind found the problem thanks for all the help guys.
MindTrixz
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 9th Nov 2010 04:39
Now I found a problem in the collision detection area. The balloons and airplane sprites dont collide at all the balloons just continue overtop the airplane and never return to their original positions. Ideas?

[quote]

Login to post a reply

Server time is: 2024-11-19 16:43:34
Your offset time is: 2024-11-19 16:43:34