• Content count

  • Joined

  • Last visited

Community Reputation

311 Neutral

About jeteran

  • Rank

Personal Information

  1. Greetings.   I have been working on creating a dynamic text that appears in the scene like the talking boxes of RPG games.   So far so good, but now I want to delete the text. I tried to use a vector to store each letter but I couldn't do it. This is my current code: void GameScene::Introduction1(float dt) { // we create the text that we will separate each letter to animate them one by one Label *set1 = Label::createWithTTF("Where am I?", "Marker Felt.ttf", 60); set1->setPosition(Point(400, 350)); set1->setOpacity(0); addChild(set1, 4); auto WChar = (Sprite *)set1->getLetter(currentLetter); auto jump = JumpBy::create(0.5f, Vec2::ZERO, 60, 1); WChar->setOpacity(255); WChar->runAction(jump); currentLetter++; if (currentLetter >= set1->getStringLength()) // if the last word is shown { for (int i = currentLetter; i > 0; i--)//I added this for to go through each letter { unschedule(schedule_selector(GameScene::Introduction1)); // these 2 lines outside ... currentLetter = 0; // ... the 'for' works perfectly // currentLetter--; // I added this for the use of the 'for' } return; } } I added that 'for' to look for a way to store each letter in a vector and then assign them the opacity to 0. I deleted the code for that so I don't get confused.   Any suggestion about it will be awesome. Is C++ so with a help on the code logic I can easily translate it for Cocos.   Thanks everyone.
  2. "I did this for a job interview" Hey CRYP7IK, thanks for the link. I will check it out. In what language is written?   "They don't expect to be impressed." That is a good one frob, I know see it in different perspective.   "So make sure your code works, make sure it does what it says it does, make sure you can explain it, make sure every word is spelled correctly, make sure it compiles cleanly even on high warning levels." Wonderful, I believe that having a piece of code that catches their attention will lead to be a winner in the interview.   Thanks so much for your responses guys, I really appreciate. Now, I will take action.
  3. That is totally correct. I bypass the name of the object in the stage. When I wrote its name (inventory) everything ran excellent.   Thanks for your contribution!
  4. That is totally correct. I bypass the name of the object in the stage. When I wrote its name (inventory) everything ran excellent.   Thanks for your contribution!
  5. Wonderful, it makes complete sense to me Buster2000.   A small background: I have been working with AS since version 1.0 , but my work has been as an Academic, not as developer (I have made many games but actually not too relevant). I want to jump to a game studio and this company, after bouncing many mails, they became interested in me. So for me, having this small questionnaire (is simple actually) is a bit scary for me.   That is the only question that I have to answer with code.   If any other tip of advice, will be wonderful!   Thanks once again.
  6. Greetings.   If you are landing a job in the game industry, and the company tells you to write a well-structured code with good style, what would you do to impress them?   I had a talk with a nice guy who have worked in many AAA companies and, based in his experience, is better to have something simple, well written and that can be implemented. Not necesarilly to write something complex just to show that you know.   Is with ActionScript 3.0, but you can give me examples of other languages.   Thanks everyone!
  7. Hello guys.   I found the solution! It was there the whole time!   What happened is that the inventory inside the stage didn't have an instance name (duh!), I put "inventory" and now the function can be read properly.   About the function, I have to optimize it because it was appear only the first object. I post here the result of the function in case someone else needs it:   function inventoryObjects() {     if (keyTaken == true)     {         inventory.gotoAndStop(2);     }       if (keyTaken == true && codeTaken == true)     {         inventory.gotoAndStop(3);     }       if (keyTaken == true && codeTaken == true && doorknobTaken == true)     {         inventory.gotoAndStop(4);     } }   Thanks everyone!
  8.   Hey buddy!   I am just around to see how are you doing and ask you if you did that topic you were planning to do, will be amazing to have a look.   Keep having a great one!
  9. Hey buddy, thanks for your response.   Indeed, when I debug the game, stops in that part, and selects the line, inside function checkInventory(): -> inventory.gotoAndStop(2);   I still don't understand why is stopping in that position when in the other rooms the function works perfectly.   I revisited the whole Room code, even I delete it all the code and just called the function, and nothing.   I checked also the door that leads to the Room, but it is coded the same as the other doors of the house.   Any other piece of advice?   Thanks a ton!
  10. Greetings.   I am going through a really head pain because of an error I am unable to resolve and, after many trials and errors, I came here to look for help.   The game logic is like this.  . The game is a mystery game, which you are in a basement and you have to find a key in order to go out. Once you have it, you go to the next room: the corridor. . Once in the corridor, you can either go left to the library or right to enter a room. . The next object (a code) is in a mask in the room. Once you pick it up, you go to the library, open a safe box and pick up a door knob. . The exit door is in the corridor. You use the door knob to exit.   Now, this is the logic of the inventory. . The inventory is a movie clip which has 4 frames / states, the first one it's empty, the second shows a key, the third shows the key and a code and the fourth shows the key, code and a door knob.  . You start with an empty inventory. . I created a function that reads something like this:   function checkInventory() {     if (keyTaken)     {         inventory.gotoAndStop(2);     }       if (keyTaken && codeTaken)     {         inventory.gotoAndStop(3);     }       if (keyTaken && codeTaken && doorknobTaken)     {         inventory.gotoAndStop(4);     } } Simple.   . I checkInventory() when the player picks up an object. . I checkInventory() everytime I enter a new scene. . Now, when I am in the basement, and I want to go to the corridor, it works perfectly. The same happens when I go to the library. And even if I go back to the basement. . But when I enter the room, I receive an error that says:   TypeError: Error #1009: Cannot access a property or method of a null object reference. at KikisEscape_fla::MainTimeline/checkInventory() at KikisEscape_fla::MainTimeline/frame5() at flash.display::MovieClip/gotoAndStop() at KikisEscape_fla::MainTimeline/corridorRightDoorClick()   . I double check everything and there is no way this error has to occur. And it does only in this room. . Looks like the problem is when I click the right door of the corridor, but it is simply a: gotoAndStop(1, "Room"); The same way is used in the other scenes.   What can this be? What am I missing?   Thanks you for any advice you can share with me!
  11. Hey Kolrabi.   Thanks for sharing this video. Looks like is simpler than it appears.   I am looking forward to making a Prince of Persia / Another World / Flashback character animation, where he has the ability to make different movements in the world, depending on the situation.   Any other resources you can share with me related to this subject I will be more than welcome to receive them.   Keep having a great one!
  12. Greetings. I am looking forward to making a small game, which will feature a highly detailed character animation. I have been playing Vector and I want to take it as an inspiration. So how do you think the character animations were done?
  13. Hello guys, thanks for your response. Jdean300 thanks for the code. I am looking forward to implementing it using the AS3 language. Monophonic you got me there, I got a little more confused here. But I will first try to implement the code before continuing. Thanks once again!
  14. Thanks jdean300 for your response. To be honest, I got stuck in the part 3) Sorry my noobness, but can you make me a micro prototype in any language you like? I can follow up the logic. Thanks once again!
  15. Hello everyone. I am making a small "escape game" in Flash AS3. The game has objects that are stored in many places of the game (key in a jar, code in a bookshelf, and so on) To make it more interesting, I want to grab those inventory objects (a key, a code and a lockpick) and put them randomly in my game objects (jar, bookshelf, picture, box, lamp, teapot) How would you achieve it? I tried using many approaches, but I didn't come up with the correct one. Thanks everyone!