• Content count

  • Joined

  • Last visited

Community Reputation

99 Neutral

About jblevins1991

  • Rank
  1. I have my main.xml page designed for tablets becuase they have more screen space. I made a second xml file named phone.xml and i was wondering if anybody knows how to make the app check what device is using the app and automatically change depending on if it is a tablet or smartphone. So if it's a tablet it will use main.xml and if its a smart phone it will use phone,xml for the menu.
  2. question about storing objects in arrays.

    sorry i thought i had, it's c++.
  3. here is my attack class attack class { int power; int init(void) { opponenthp=-power; } }; if i store attack.init() in an array whenever i select the unit that stores attack.init() would run that function correct? if there are any suprises or things that you may want me to know about the way im doing this feel free to tell me . thank you for anybody who helps ive only been programming for 6 months.
  4. input system

    void input::init keys(int keys) { for(int i=0;i>256;++i) { keys[i]; } keys[0]; keys[1]; keys[2]; ....more keys } i am looking for a way to assign a key to an element of this array. so i could make keys[0] store the 'a' key. can somebody point me in the right direction? (inspired by id tech engine )
  5. rpg game question

    i don't plan on giving it out, its just something that makes learning game programming fun and interesting. so i can just do something a long the lines of... Pokemon *pika = new pikachu;
  6. Im making a pokemon rpg game and i need an idea on how to create target pokemon. i have the pokemon class made, but i dont have an idea on how to create the enemy pokemon class. should i use inheiritance?
  7. _int64 mBaseTime?

    nevermind i figured it out.
  8. _int64 mBaseTime?

    I bought a directx 10 book that uses the variable [b]_int64 mBaseTime [/b]and i have no idea what this is. Does anybody know if it is from a specific library? If so what library is it from? I get an error saying that it is [b]an undefined variable[/b].
  9. Array question.

    sorry, i got confused. the array holds the exp amount needed to level up (see below) int exp; int exptilnextlevel[99]; if(exp>=exptilnextlevel[99]) { ++level; } would this work?
  10. Array question.

    Is there a way to increment to the next data element in an array when the player levels up?
  11. Array question.

    if i have an array called [b]int level[99][/b] and i use the following code [b]++level[99] [/b]does that increment the array's element. Example say we are at level 3 in our game meaning the level array would be at array[2] for our exp til next level, if i were to level up and use ++level would it be at level[[3]?
  12. There are my theoretical classes for my question: class Warrior { public: int m_hp; }; here is the item.h code #include "Warrior.h" class healingitems { int m_healhp; void Heal(); }; here is the item.cpp file's code #include "item.h" void healingitems::Heal() { warrior.m_hp =+ m_heal; } The Heal() function takes the warriors hp stat and atdds m_heal. so lets say that i am low on health and i want to use a potion and the potion in my game heals 30 hp (that is this functions purpose). My error is "a non static member must be relative to a specific object". How would i make it to where it heals an objects hp without being specific?
  13. stumped

    [quote name='Cornstalks' timestamp='1328855052' post='4911574'] [code] class Player { int hp; // set it to some value in the constructor (maybe the same as maxHp at first) int maxHp; // set it to some value in the constructor (80 in your example) public: void applyHp(int amount) { hp += amount; if (hp < 0) hp = 0; // if amount is negative (i.e. damage), don't let an invalid amount of hp be assigned if (hp > maxHp) hp = maxHp; // if amount is positive (i.e. drank a potion), clamp the hp to the max } }; [/code] Maybe not the best function name or the best way to abstract applying damage/health bonuses, but that's the idea behind how you clamp a value. [/quote] Thank you very much sir.
  14. stumped

    im making a simple game to test my abilities. Lets use the following code as an example: class player { int hp; }; this is my theoretical player class and lets make int hp equal to 80. i want to know how i make it to where 80 is the max hp can be and will not be able to go over. like for example if i use a potion and potion in my game revives 60 hp and i already have 50 how do i make it to where it tops off at 80 and doesn't rise to 110?
  15. Storing Pokemon in an array?

    [quote name='Cornstalks' timestamp='1328148006' post='4908583'] You mean something like [code] class player { public: Pokemon playersparty[6]; }; [/code] ? Or do you mean something much more generic, so you can store both Pokemon and players in this array? FYI, creating a Pokemon-style game is fine, but using trademarked and copyrighted characters and IP is not. [/quote] Thank you for the help. I know that using trademarked IP is illegal sir. I appreciate your concern and vigilance. I am creating my own character etc. Any clue on how to create attacks?