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.

Newcomers DBPro Corner / Help With Pong Like Levels/Level building, Effects and Items!

Author
Message
Justintime Games
15
Years of Service
User Offline
Joined: 3rd Jan 2009
Location:
Posted: 25th Feb 2009 23:07
I really need help with a pong game im making I want to add levels, scoring systems, effects, and items! if you could help that would be great here is my code!



I am new to the coding so could you also explain it?!

JG
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Feb 2009 05:23
Looks like you're doing pretty well there. However, I'd like to warn you that no one is going to write all that code for you. See what you can do yourself. If you run into specific problems, post them up.

Justintime Games
15
Years of Service
User Offline
Joined: 3rd Jan 2009
Location:
Posted: 27th Feb 2009 20:21
Thanks that makes since, but i would at least like to know how to do level transactions then i could create diffrent kinds of levels by myself.

Thanks again!

JG
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 27th Feb 2009 23:27 Edited at: 27th Feb 2009 23:28
If you want to be able to load certain pre-made levels, you'll want to come up with a file format for storing all the data you need about each object in the level, then make a function that will read the data and make objects with it.

For example, let's say your only level objects were cubes of a certain size. In this case, all you need to make the level is a list of locations where there should be cubes. This file would make a level with 3 cubes:



Then, of course, you need a function to read the file. That would look something like this:



Justintime Games
15
Years of Service
User Offline
Joined: 3rd Jan 2009
Location:
Posted: 28th Feb 2009 19:21
Thanks bmaczero. I get what you mean, but I can not understand the code your using. Could you explain it?

JG
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 28th Feb 2009 20:36
Here's the code with more comments:



I'm guessing your confused about the FILE commands. Basically, OPEN TO READ will open a file, such as a text file, so that you can read data out of it. This is quite handy for saving levels or saved games.

When you use any read commands on the file, such as READ STRING, the program reads the next available piece of data as though it were a string. So if a file read:

Green
Blue
Purple


And you opened it to read and read:

READ STRING 1,temp$
READ STRING 2,temp2$
READ STRING 3,temp3$

Then you would have stored "Green" in the string temp$, "Blue" in the string temp2$, and "Purple" in the string temp3$.

Justintime Games
15
Years of Service
User Offline
Joined: 3rd Jan 2009
Location:
Posted: 2nd Mar 2009 02:03
oh thanks. i see how it works so if i put...


then that would make the next level if i tweeked the numbers a little?

JG
www.justintimegames.webs.com

Login to post a reply

Server time is: 2024-11-25 10:20:51
Your offset time is: 2024-11-25 10:20:51