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 / Problem with a 2D game

Author
Message
TokenFlyer
12
Years of Service
User Offline
Joined: 22nd Apr 2012
Location:
Posted: 30th Apr 2012 12:38
So my first problem seems pretty straight forward. outside my while(LoopGDK()) loop i set an int variable time = 0. then i have time++; within the main while loop. I'm trying to get some text to go across the screen after a certain amount of time, but once I try to make time > 300 for the trigger to do this, it doesn't work. Whenever I make the trigger at or before 300 it works fine.

also, I am trying to simulate gravity for when the main character in the 2d game im making is not touching the ground. i tried doing something similar to a time incrementation and doing dbMoveSprite() where the value starts at say 5 and decrements .01 each time. this doesn't seem to do anything. Another solution i thought of was instead of simulating gravity, just do like a cosine curve from 0 to 90 degrees maybe? I can't seem to solve this no matter what I try.

another problem I had with music. two of my mp3 files work and two did not. the two that didn't are bigger so this is the only thing I can think of as to why it wouldn't work. this is my smallest problem and not really a big deal.

any help would be appreciated, can post code if necessary.

adsfffffdscsdd
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 30th Apr 2012 21:52
Without a snippet for your time problem there's not much to say apart from speculate.

For your dbMoveSprite() problem, are you using 'float' variables instead of 'int'? Also the gravity can be solved just by decrementing the Y coord each frame by a certain value. You may have to do checks on the Y coord to make sure it doesn't go out of range, and collisions, etc.

Your MP3 problems I'm not sure, have you tried playing them from DBP and seeing if they work with that? Could be anything from a bitrate format not being compatible, not sure. Anyhow, if you are still needing them, then you could google the bass.dll which plays almost any music file. You will have to include the bass.dll in your executables directory but it does come with a header file which you can include in your source.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
TokenFlyer
12
Years of Service
User Offline
Joined: 22nd Apr 2012
Location:
Posted: 1st May 2012 03:40
here is the code I have so far.

https://gist.github.com/2564003

if anything is confusing let me know. I didn't include any of the header files, just the cpp's. Also, Im not done yet, I still have to add in player deaths, some sort or point system, and make it so the speeds increase with each new stage (in addition to the problems I am asking about). I can't even do these last two until my in game timer works, something that should be simple but isn't working for me.

ANY sort of help would be massively appreciated because I really can't get it.

adsfffffdscsdd
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 3rd May 2012 20:12 Edited at: 3rd May 2012 20:29
Edit: nevermind that...


Login to post a reply

Server time is: 2024-04-25 13:22:47
Your offset time is: 2024-04-25 13:22:47