Toby R's Recent Forum Activity

  • Hi ppl,

    I have a character (sprite) which is my player. When player walks into some "doors" he should be transported to the next layout (level) and be able to back to previous one layout (level).

    Sounds trivial, but... this character (sprite) has several instance values like healthPoints etc. No matter what I try I can't get the instance variables to persist.

    What I have tried:

    1. Add persist behaviour to the object - It doesn't work, but that's understandable cause Persist behaviour remembers the state of the object instance for the particular layout.

    2. Set "playersLayer" to global and player object to global - in result object is automatically (no need to add it manually) created on the layout with the initial state of the instance variables. Well I thought "global" moves the instance to the next layout so I would expect to keep the instance variables unchanged... but not

    3. Allright so I've tried to set layer and character object to global AND add a persist behaviour hoping maybe this will keep the instanca variables set up... but again failure.

    I think I am missing something right? Do I really need to save those values somewhere in a dictionary or so and then load it after layout switch or there is a smart way to move The Player in one piece all over the layouts?

  • For your solution you can add a boolean instanca variable which determine if exp already got calculated or not... BUT checking all enemies all the time just for calculating exp points seems to be like a connon for a fly.

    Each enemy/target should have an instance variable "health", then

    On BULLET collision with TARGET

    • decrease TARGETs health points
    • if TARGETs health points <= 0

    -- run "dead" animation

    -- calculate XP

    Something like that should work, if it doesn't, just give us a screenshot cause there is something else giving you problem.

  • Me and small group of friends are launching social media profiles and a webpage for our projects and prototypes very soon. Maybe even today . Once it's done I'll let you know!

  • Yup, after deleting cookies everything works fine.

  • I'm about to play around with Multiplayer object. I read the tutorials etc. But all tutorials are based on client(peer) and server(host) code as one project.

    Isn't that dangerous to give client the hosts code? I'm just wondering what is the good practice in multi user games where host gonna be run 24/7 on separate server anyway.

    Is it a good practice to make separate projects for host and peer in C2?

  • When I try to enter any tutorial I get the following error:

    [quote:yiekjlml]Server Error in '/' Application.

    An item with the same key has already been added.

    I try to access it from the mobile Chrome browser, but it looks like a server issue.

    Does anyone have the same problem?

  • Just post your implementation screenshot, we're gonna 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
  • I'd vote for switching visibility and position. Also keep in mind that Text object is way more resource consuming than Sprite font object. So if you plan to use Text object and export it on mobile devices you will notice a small lag (at least on devices like SGS4 or so) before Text object will get rendered.

    Anyway C2 engine does not render invisible objects (as well as objects outside the game window), so everytime you create a new object C2 will have to build and render it. If you play with visibility, C2 will build it only once, put it into the memory and every next rendering will be faster.

    However if you gonna use Sprite/Sprite fonts and export it to any other plaftofm than mobile, I don't think there will be any noticable performance difference no matter which way you choose.

  • I've tested export with Crosswalk and "normal" Android using Intel XDK. Still Crosswalk performs much better on Android 5.0+ than the regular Android export. At least in my case.

  • I use the following:

    "floor(random(x+1))" if you need a range between 0 and X.

    OR

    "floor(random(b-a+1))+a" if you need a range between A and B.

  • 1. You should read manual o understand all properties, you will be able to set it up properly to suit your project well.

    2. Minimum Android version requirements you set up in Intel XDK by setting the minimu Android API requirements.

    3. This is not so important, you can set it to "no".

    4. For this you also should read tutorials and understand them. You may need to set up some plugins, depends on your project. Build setings are the most important, and most of them are self explainable. And the last one are the icons and splash screen for your game. You simply upload pictures there.

    5. It depends on your project needs - as I said above already.

    6. Various plugins, are in various places... so again - depends on the plugin.

    7. Well this is not enough to tell what is wrong. Probably you use some plugin which is not added.

  • I think you mean Text object not TextBox object.

    1) You can use "System -> Create Object" to create any object instance whenever you need, or you can spawn it from another object.

    2) Text object will bring you a lot of performance issues especially if you want to scale it on the fly. I stronlgly recommend to use SpriteFonts, and then you treat them like sprites, so you can easily scale/resize.

    3) You can create an invisible sprite called for instance "pinBoard". Then every visible/movable (by scrolling/sliding) objects should be pinned (Pin behaviour) to this sprite. The "pinBoard" itself should have "drag&drop" behaviour with only vertical axis enabled. This is the easiest solutions. You can of course add scroll limits etc.

Toby R's avatar

Toby R

Member since 23 Mar, 2015

Twitter
Toby R has 18 followers

Connect with Toby R

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies