Search:

Type: Posts; User: TenTierHook

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,098

    Private & protected

    I need to use inheritance but I also need accessors & mutators
    Do protected variables act like private variables but with inheritance?

    If I use private and inheritance my subclasses can't find...
  2. Replies
    1
    Views
    828

    Reading game data from file

    I am creating a very simple 2d game ...
    My wall and item placements in the level are read from a text file.


    I am unsure what type to read them into.
    I was going to use predefined arrays but...
  3. Replies
    1
    Views
    1,202

    String File Input

    I am trying to read a file to create the structures for a small 2d game.
    I am reading in integer numbers to construct the walls.

    At the moment I am using getline and have each number on a...
  4. Replies
    9
    Views
    4,772

    Do I just use the abstract class header file as...

    Do I just use the abstract class header file as the mass blueprint with prototype functions for all subclasses and have the implementation in each subclass?
    Basically I have a load of empty...
  5. Replies
    9
    Views
    4,772

    so I changed some of the code Entity...

    so I changed some of the code


    Entity *entities[2];
    entities[0] = new Player;
    entities[1] = new Map;

    I added all the main classes to entity as virtual
  6. Replies
    9
    Views
    4,772

    I think I got the general idea but I am still...

    I think I got the general idea but I am still getting errors


    in main

    Entity entities[2];
    entities[0] = new Map;
    entities[1] = new Player;

    In my player class header file
  7. Replies
    9
    Views
    4,772

    Many entities.. several map blocks.. several...

    Many entities.. several map blocks.. several items... 2 players most likely

    By iterator I mean for loop :/ ... think I used the wrong term there.

    Assuming I have an abstract class entity with a...
  8. Replies
    9
    Views
    4,772

    Abstract classes and iterators

    I am making a game entity class for a 2d allegro game of mine.
    The abstract class will be entity .. the subclasses will be player, map_blocks and items

    The main reason I am using it is to have...
  9. Replies
    4
    Views
    4,114

    That worked. Thank you. I am starting to...

    That worked.

    Thank you. I am starting to realise that C and C++ integrate quite a bit.
  10. Replies
    4
    Views
    4,114

    convert string to const char?

    I am using strings to read in from a text file using getline.

    I am trying to print this string to the screen using the allegro game library calling the function textout_ex.
    textout_ex

    It...
  11. Replies
    6
    Views
    14,381

    knowing its 8 instead of 7 helps a lot sipher.. ...

    knowing its 8 instead of 7 helps a lot sipher.. thats solved it methinks
    that calculation makes a lot more sense now

    You are quite correct brewbuck, I am familiar already with this idea for...
  12. Replies
    6
    Views
    14,381

    0 100 0010 0101 0101 0110 0110 0010 1010 ...

    0 100 0010 0101 0101 0110 0110 0010 1010

    Okay worked it out a bit more


    0 100 0010 0101 0101 0110 0110 0010 1010

    The first bit on the left is the sign

    0 100 0010 0101 0101 0110...
  13. Replies
    5
    Views
    4,220

    closing and reopening the file worked using ...

    closing and reopening the file worked

    using
    clear()
    before, not after
    seekg(ios::beg) also worked
  14. Replies
    6
    Views
    14,381

    Binary to 32 bit floating point

    Trying to get to grips with the idea of floating point.
    Just looking to convert a binary to float.

    The last 8 bits are the exponent.. right?
    The most significant bit is on the right?
    The first...
  15. Replies
    5
    Views
    4,220

    Reset to Beginning of file

    Im doing some simple fileinput.. I am having issues resetting the file read to the start of the file. Basically If I run the function twice it won't work, once is fine though! :/ . I tried .seekg()...
  16. Replies
    2
    Views
    1,055

    Excellent Idea actually.. thanks!

    Excellent Idea actually.. thanks!
  17. Replies
    2
    Views
    1,055

    getline comparison + audiobooks

    I am trying to read a formatted file where the first two characters in each line denotes the type of line it is, it's related to music.
    For instance "T:" denotes its the title.
    One song can have...
  18. Replies
    3
    Views
    6,058

    So if I use malloc/realloc I can make that...

    So if I use malloc/realloc I can make that dynamic?
    rather then a static [100]

    Then I can search by date first, then, if any dates overlap, check each object by room




    For(amount of...
  19. Replies
    3
    Views
    6,058

    Hotel Booking system

    I am trying to create a ms-dos hotel booking system for college.
    It is just an exercise.

    I need to mimic checking for room availability. If a certain room is booked for a certain date I need to...
  20. Replies
    2
    Views
    1,358

    Hotel system

    I am trying to create a hotel booking system.

    Should I use a 2d matrix for rooms
    and another matrix for the dates?

    A cross reference, or is there a better way
Results 1 to 20 of 20