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 / Arcade Game; Showing score, life, etc.

Author
Message
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 27th Nov 2009 06:56
Hello everyone. I'm actually not new to this, but I have been learning on some bases. Only thing I have yet to figure out is how to show life and the score, plus going on to level 2 as well. I also tried to make my AI shoot me, but it didn't work out to well, for some reason. Now, I'm asking for some help on these 4 things. Don't say, look at the tutorials or anything related to the tutorials that came with Dark GDK, they do not explain anything. All they have is comments, which I need a video that explains things. I'm not a bright person and learns very quickly. I went through a few youtube video's and such, which helped be a lot. If there is any tutorials that I have missed on this site related to my help, it would be greatly appreciated.
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 27th Nov 2009 20:03
Bump.
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 28th Nov 2009 17:31
To show text on the screen, use dbText (xcoordinate, ycoordinate, "text");

As for the AI, you'd probably need to post code so people could get a better idea of what you need.
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 28th Nov 2009 21:01
Thanks for your comment. I actually have an idea for life and score showing on your screen. I also figured out on the AI shooting me. Well, he shoots straight not at me, but good enough for obstacles and stuff.


- Only thing that is making me work harder is jumping. I looked all over the forums, good people coding good things on how to make your sprite jump, but the code that present does not work. Any help on that specific problem would be appreciated.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 29th Nov 2009 05:22
To jump, you would have a variable to hold the y force of the object/sprite. then you have a constant gravity, every loop you add the gravity to the y force, and add the y force to the player y. if there is collision then set y force to 0

New Site! Check it out \/
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 29th Nov 2009 11:39
Mind showing an example code? I might actually have an idea of what you're talking about.
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 30th Nov 2009 09:35
Bump!
Snowyowl
14
Years of Service
User Offline
Joined: 30th Nov 2009
Location:
Posted: 30th Nov 2009 15:58
Here, try this for an example code.

You'll need to write the "collision" function yourself. It accepts two arguments (an x-coordinate and a y-coordinate, both of type double) and returns whether or not the object, when placed at those coordinates, intersects a wall or not.

To add user input, use this function in addition:

It uses the same collision function. Hope that helps!
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 30th Nov 2009 20:00
You could explain how it works, etc. Or make cleaner code. (Anyone else have an idea of jumping?)
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 1st Dec 2009 03:48
Assuming this is a sidescroller type game... (Please forgive me if I make any mistakes, I haven't tested ANY of this stuff)

You would first detect whether or not the button to jump is being pressed, let's say spacebar.



Then you'd want to have the player's "y speed" increase. You might also want to add a few "dummies" or whatever you call them to make sure you can't hold down the spacebar and fly all the way to the sun. If there is a better way to do this (anyone) please tell me!




Then you'd want to have the player's y position increment by their y speed.



And you'd also want to decrease the y speed every frame



Then finally, when the player collides with the ground or something you'd want to set the y speed to 0.



Alright I think that'd do it. I'm really tired so I'm sorry if I wrote anything stupid/that doesn't make sense.
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 1st Dec 2009 06:29
Thanks. Going to try this out now.
Easelm
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 1st Dec 2009 06:45
The code doesn't work. Plus, I just noticed that you don't identify the playeryspeed, playerground, playerypos, dummy and dummy2. It would be appreciated if you make a script that identifies the things that is needed with the code. It makes me go to a point where I don't know what to do.

Login to post a reply

Server time is: 2024-10-01 18:31:23
Your offset time is: 2024-10-01 18:31:23