althea_texas's Recent Forum Activity

  • During the past several days, I have pursued multiple strategies for implementing a collection scheme. My current attempt involves the use of two arrays. An inventory array keeps track of item names, item costs, and item weights. I use separate animation frames inside a sprite named 'objTreasure' for different types of treasure. Upon collision with an item, C3 destroys the item and records the frame number in a collection array.

    When I get to the final level, I'm trying to loop through the array and spawn the collected objects on the final page. Debugger shows me that the array is being populated, but I cannot -- for the life of me -- get anything to spawn on the final level. I added a loop counter as a global variable and confirmed that the loop is actually running.

    I would be grateful for any suggestions! The link is:

    transmedia.trinity.edu/~adelwich/temp/array-inventory-animation-frames.c3p

    Thanks!

  • Thanks, blackHornet. Back to the (virtual) drawing board! :)

  • I have been experimenting with various possibilities for keeping track of objects that a user collects throughout the game. In response to my original question, Plinky suggested two approaches: global variables for relatively simple scenarios and arrays for more complicated collection scenarios.

    I understand how to solve this with global variables, but I'm struggling with implementation using arrays. As you can see from the attached file, I am using two arrays. arrayInventory is a sort of 'map' of the inventory slots on the final page. It includes a slot number and the x/y coordinates where sprites should be placed when displayed in the inventory. Meanwhile, arrayCollection is an empty array that I am using to store the UID of collected sprites.

    Everything goes swimmingly until I reach the final stage of my game. Using the debugger, I can see that my collection array has been populated with the correct UID, but I cannot figure out how to spawn an object based on this UID information. Is there anything I can do with the UID at this stage?

    I realize that it might be illogical to spawn an object with UID since it references a *unique* identifying number for the sprite. But it seems that I should be able to reposition the sprite with the UID if it hasn't actually been destroyed.

    (As a side note, I can imagine another approach that keeps track of things by using sprites that have multiple frames and named animations, but I want to figure out the UID thing first.)

    I hope I'm posting this before everyone goes to bed across the pond. :) The file is posted at:

    transmedia.trinity.edu/~adelwich/temp/array-inventory-by-uid.c3p

    Thanks!

  • Thank you so much, Plinkie! For game projects with a relatively small scope, I will encourage students to keep track of things with global variables. For larger projects, I will encourage them to use arrays.

  • Two students in my "mobile gaming" course are pursuing final projects that involve some sort of collection mechanic. One student is reskinning the classic breakout game and another student is creating a language learning game that teaches users basic Swedish.

    In both games, players are collecting objects along the way. On the final layout, we would like to be able to display all of the collected objects on the screen.

    For now, we're not worried about positioning on the page. We would simply like to be able to quickly check to see if an item was collected or not. If the object has been collected, it should be displayed on the final page.

    At first, I thought we might be able to do this with families. All of the collectable objects could be added to a family, and a family instance variable (isCollected) could be used to keep track of whether or not the variable was picked up. Then, on the final page, we could just loop through all items in the family and check to see which items should be displayed.

    Unfortunately, as you can see from the linked file, this solution doesn't seem to work.

    transmedia.trinity.edu/~adelwich/temp/sample-collection-approach.c3p

    Debugging the file reveals that collecting the item successfully sets the isCollected instance variable, but then the object disappears on the next level. I have applied the 'persist' behavior to the entire family, but that doesn't seem to do the trick.

    I also tried making all of those objects global, but then the objects appeared on every single layer, even when they weren't supposed to be accessible.

    I would be grateful for any advice. In other programming languages, I would try to tackle something like this by putting references to the objects inside an array. Is that the preferred approach for C3?

    Thanks!

  • Hi -- I'm getting ready to fly across the country and would love to read through the C3 documentation from start to finish. I realize that documentation is dynamic and constantly being updated, but was wondering if it's possible to get the entire manual in a single PDF or web page.

  • I use Construct 3 in a college classroom with older students (17 to 22) and have found that the cloud storage system makes it relatively easy to keep an eye on student progress. This is how I do it:

    a) I subscribe to a paid Dropbox account that offers 1TB storage.

    b) Dropbox is installed locally on all of the lab computers, with all computers pointing to the same Dropbox account. I have created project folders for each student inside that Dropbox account. (Note: These folders are not stored inside the Apps folder that C3 uses for cloud storage. These folders are used for all of the students' other digital production work.)

    c) Within the Dropbox Apps folder that C3 uses for cloud storage, I have created a second set of student project folders. I ask students to make sure that *all* of their C3 projects are saved and clearly labeled in these folders. If they encounter problems along the way, I can easily access their folders and files through Dropbox from anywhere in the world.

    If it is a hassle to install a local version of Dropbox on all of the lab computers at your school, you could just skip step b.

    As for registering students in the class, this is part of the educational package that C3 offers. At the beginning of the semester, I assigned a license (or seat) to each student. It's easy to do, and -- in my opinion -- reasonably priced. If it was much more expensive, I'm not sure I could convince my school to cover the costs, but C3 is currently an excellent value proposition in the classroom.

    Aaron

  • My students are currently working on a platform game project using Construct 3. Several students have encountered an odd problem related to enemy movement.

    When they were first learning how to use Construct 3, I walked them through a simple platform game exercise based on Ashley's platform game tutorial from 2012. This approach uses invisible collision boxes and a boolean instance variable to make sure that enemies turn around when they reach the edge of the platform.

    This solution works on most of the student projects, but not for all of them. The weird thing is that this works for a while, and then the enemies suddenly start traveling past the collision boxes that are supposed to make them turn around.

    Something similar happened to a student two years ago, and we never figured out what was causing the problem.

    We have been trying to hack around this problem by identifying the troublesome enemy sprites via UID and adding an additional layer of code, but this is obviously not an idea solution.

    Does anyone have ideas about what might be causing this?

    I realize that it's easier to debug with a CAPX file attached. I hesitate to upload my students' work without their permission.

    Aaron

  • Thank you, Ashley!

    BadMario,if you haven't had a chance to investigate Construct 3 yet, I highly recommend that you check it out

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, that answers my question. I thought that someone in the community might have put together some sort of guide or heads up for newcomers. Such a document might also be persuasive for users who aren't sure about switching from C2 to C3.

    Thanks, Newt. I will start reading over the release notes. I might also try to start a thread encouraging current C3 users to share their thoughts about new features and workflow changes that they find most awesome about C3.

  • This question did not get a response, so I will try rephrasing it. :)

    Is there any single document or page which can help C2 users understand some of the most significant changes and improvements in C3?

    For example, in the process of helping my students trouble-shoot their games, I realized that C3 has added the PERSIST behavior. This is so cool!

    During the past two weeks, I have also learned that the event sheet editor has incorporated all sorts of useful changes.

    I will read through the C3 manual from start to finish, but it would be awesome if there were some sort of document which identified all of the changes and improvements that ex-C2 users should know when they begin experimenting with C3.

    Thanks!

  • :)

    It has been a while since I poked around with local storage, but I remember that you have to check to see if locally stored variables exist before you try to read and write those variables.

    This tutorial was very helpful:

    javajdk.net/tutorial/localstorage-in-construct-2

    This event sheet diagram is from that article:

    As the author of that tutorial explains:

    "The key to understanding this event sheet is that Construct 2 LocalStorage is asynchronous. Every LocalStorage action has a matching event that you can use as a condition. Every request to LocalStorage generates an event rather than giving you an answer right away. Remember LocalStorage always says, “I’ll get back to you.” It never gives you something exactly when you ask for it, though it is typically so fast your users won’t notice the difference."

    I struggled with other local storage tutorials but something about this person's explanations made sense to me.

    Best of luck. Please let us know if you solve the problem, Matt from Manchester!

althea_texas's avatar

althea_texas

Member since 26 Aug, 2016

Twitter
althea_texas has 3 followers

Trophy Case

  • 8-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies