destoyersinc.freeforums.org

Where anything Can And WILL Happen!
Home Page Play games in the arcade Home Page Home Page Home Page
  Register
Login 
View unanswered posts View active topics

Delete all board cookies

All times are UTC



Welcome
Welcome to destoyersinc

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!


Home Page Home Page  [ 15 posts ]  Go to page
1, 2
 >> Next 
  Print view
Previous topic | Next topic 
Author Message
Offline 
 Post subject: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Sun Nov 09, 2008 11:37 pm 
User avatar

Joined: Sat Nov 08, 2008 9:17 pm
Posts: 80
ALRIGHT!
so, right now we have part one of the three part necessity
-We can now read a text file
All we have to do now is focus in on a specific string within the txt and then be able to use the string.

Using this we can actually focus in on a specific line, making it alot easier.
2/3
Link
loading text wrote:
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}

else cout << "Unable to open file";

return 0;
}


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 12:00 am 
User avatar
Site Admin

Joined: Thu Nov 06, 2008 8:52 pm
Posts: 361
Nice work!


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 12:27 am 
User avatar

Joined: Sat Nov 08, 2008 9:17 pm
Posts: 80
Ok Heres one Idea about the txt

With every Text the format will be the folowing;
Quote:
Graphic Location
Graphics animation
etc etc etc
Graphics end

velx
vely
etc etc etc
Physics end

Block a
Block c
Block d
Player
etc etc etc
Hittest end


Quote:
State1end


So Pretty much
you will Stop loading a particular aspect of the code when "String is = x"
-However, all the strings up to "String x" will be loaded and used

If a string is ended with State1end, then it will go on to read what state 2 is.


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 12:29 am 
User avatar
Site Admin

Joined: Thu Nov 06, 2008 8:52 pm
Posts: 361
Nice, We're making progress!


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 2:53 am 
User avatar

Joined: Sat Nov 08, 2008 3:05 pm
Posts: 260
It's pretty much the first day of work also. I probably won't be able to code in C++, but you need GFX for it, I'm your guy.


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 5:57 pm 
User avatar

Joined: Sun Nov 09, 2008 5:00 pm
Posts: 6
if he's gfx that means that im either sfx or co-producer :?: :|


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 6:42 pm 
User avatar

Joined: Sat Nov 08, 2008 3:05 pm
Posts: 260
More than one person can do the same things. I'm just not cut out for coding right now, so I'm doing that instead.


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Mon Nov 10, 2008 8:07 pm 
User avatar
Site Admin

Joined: Thu Nov 06, 2008 8:52 pm
Posts: 361
Okay. Just keep working. If anyone comes up with ideas for the game, feel free to post it!


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Tue Nov 11, 2008 9:02 pm 
User avatar

Joined: Sat Nov 08, 2008 9:17 pm
Posts: 80
I think I've discovered a means to use the strings, But I'm not sure yet
heres the URL

If you want to help, I just need to figure out what parts of the code do what

Not sure how its done, but I think it has something to do with istream (Input Stream)
But I think I have all the parts I need,
Now its all about putting them in order

I'm still looking more, But I recently hit a snag.
Apparently, you cannot change a string into an Executable code ([url=http://bytes.com/forum/thread170066.html]Source[url])
THis was pretty much what I was trying to do.

Makes me think about Trying to learn java again....

In anycase,
I'm now thinking about making the program run text documents instead of just gather strings from them.

THis Might get a bit complicated but in all, I think its worth it

Everything Can be catagorized by
1) Item
-Is it used immedietly?
-What does it do when used?
-What
2) Carryable Items
-If hit on top what does it do?
-If thrown what does it do?
--A shell will go sideways quickly
--A Boomerang will go up, sideways then back towards you
-What if it hits something? (For each object; Block, terrain, Item, Player, Another Carryable Item)
3) Block
-Direction it needs to be hit
-Necessary Buttons (To go through a pipe, you must press down)
-What it does
4) Enemy
-States (Depending on which state an enemy is in, they will move differently or be invincible, like a transformer. It just calls different things from them)
--Trigger for state change (When a Turtle is Stepped on it will turn into a shell and a turtle)
--Paths/physics for each state
--Hitboxes for each state and what it causes
--Graphics/Animations for each state.
5) Theme-Which includes; Tileset, Music and Physics


Overall, When you run one "Level script"
-It would only cause a few of these other scripts to be loaded
--Pretty Much Just Repeating what is currently in place except each Script would have its own file, making everything alot more convienient for those trying to make items, enemies, blocks, etc.


Image


Top
 Profile  
 
Offline 
 Post subject: Re: Loading Texts (Finding Texts, Focus on string, using string)
PostPosted: Tue Nov 11, 2008 11:14 pm 
User avatar
Site Admin

Joined: Thu Nov 06, 2008 8:52 pm
Posts: 361
This is coming along well!


Top
 Profile  
 
Search for:
Display posts from previous:  Sort by  
Home Page Home Page  [ 15 posts ]  Go to page
1, 2
 >> Next 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cron