Laurent's Recent Forum Activity

  • Not really, I'm trying to recreate the interactivity like in this video (starting 0:30) youtube.com/watch

    But with a more natural move. In the video, pictures appear to float in the air. I'd like them to behave in a more static way (with just a little inertia) to make them act as if they were on a wooden desk.

    Also, i need them to come on top of the pile when clicked (not in an animated way though), considering every photo are a container made from different sprites with interactivity.

    I managed to find and embryo of solution by rotating the sprite in the drag direction. But there are to problems still :

    - movement is too jerky

    - rotation applies to image point, not to point where object is touched

    File is here

    https://www.dropbox.com/s/h3ageq37xyvnzpq/TestDrag2.c3p?dl=0

    Imagine sprite has 3 image points, would it be possible to use the point nearest to touch to apply the rotation to ?

    There's a topic about this exactly also

    construct.net/en/forum/construct-3/how-do-i-8/add-physics-dragdrop-166346

  • If you are planning to use Physics, here is a simple example:

    https://howtoconstructdemos.com/throw-a-physics-object/

    Dragging a container object may be tricky. You can try attaching objects with pin for dragging, and then un-pin and re-connect them using Physics joints. But this may require a lot of trial and error.

    Thank you ! I had a look at your example before but saw that sprite doesn't move when it is picked.

    I understand container is tricky. I already have a problem with changing Z index of all of its element. When I change the z index of the main element, the other elements of the group.

    Very strange...

    https://www.dropbox.com/s/7ckmwu6xzx1x62n/TestDrag.c3p?dl=0

  • My project looks like the top of a desk with objects on it.

    Every object can be dragged to another place on the desk.

    Instead of the regular movement, I'd like to make the object move a more natural way.

    The idea is that when the object is draged it starts just a little bit to rotate around where it has been clicked and this rotation is related to the drag speed.

    I know this involves physics but I don't know how.

    Second question :

    One of my object is a container with many objects attached to it and everything needs to move together.

  • I've created a video player for an exhibition in a museum. The project is to be converted to .apk in order to be played on Android Tablet. I export to debug unsigned .apk sent to wifi to the tablet and thus I don't need to go via Play store.

    Everything is fine so far. the video plays correctly. Except for a function I added to spped up the video onward and backwards . The function works as when a sprite box on screen (for backward/forward) is taped, 2 seconds are added or substracted to playbacktime.

    This works great in preview mode and online but from the apk on tablet, Set Playbacktime function just restarts the video from the beginning.

    I've tried with ogv and WebM sources and they just don't show on screen. Mp4 seems to be the only format playable from apk.

    Any idea on how I can solve this ?

  • Hello,

    I'm building an app for a museum that mainly is a video player. I have 3 pages with one video on each. Videos can be up to 30 mb.

    The app is exported to .apk and installed on a Samsung tablet.

    Everything works fine except videos (preload is on) the time to launch, even if user comes back to a page where he already played a video. I thus guess Preload doesn't work as it should.

    How can I avoid this ?

    And if I can't, how can I get video preload status in order to show user the video is about to play ?

    Tagged:

  • Thank you for your replies (and sorry for late answer)

  • In my game, travelling distances are important. They are stored in an array names ArrayDistances like this :

    At some points of the game, I have to retrieve the values in the table but instead of using numbers for coordinates (I know how to do that), I need to use places names (chateau, village, etc).

    So my code won't be :

    Value = ArrayDistances.At(2,3)

    but

    Value = ArrayDistances.At(cell X coordinate where value ="tour", cell Y coordinate where value="village")

    Any idea on how to do that ?

    Tagged:

  • Thanks !

    Interesting, indeed

  • Sure, I'm aware of that but I know there is a more direct way.

    I managed to achieve this using Sprite IID.

    The syntax of the "set text" is :

    "Hitpoints : "&sprite(2).Value

    where 2 is the sprite IID and Value is the instance variable.

    So if Value=40, the code above displays for sprite IID=2 "Hitpoints : 40" in textbox.

    Instead of using IID, I would like to use another instance variable, for example Type="zombie"

    So the code would be something like :

    "Hitpoint : "&sprite(Type="zombie").value

    I tried many syntaxes but came up with nothing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    How do I add to a text box the value of an instance variable ?

    Example :

    - Sprite has 2 instances variables : ID and Value

    - There 3 instance of Sprite on screen : ID = "Gold", ID="Health", ID="Time"

    - There is a textbox on screen

    - How do I set textbox's text to Value of Sprite instance ID="Health" ?

    something like :

    set text : "Player's hitpoints : "& sprite(ID="Health").Value

    I suspect some complex expression formula is involved here...

  • Hello

    Thanks for your answer.

    could you be more specific ?

    I think I get your point but it is still a bit blurry.

  • Hello

    My game is a top down game with a huge map scolling under the player's sprite that has a scrollto behaviour attached to it.

    So far, the sprite is at the middle of the screen but I would like it to remain at the center of a window that is a bit offset from the screen center.

    Is there a way to offset the scrollto behaviour in order to achieve that or do I have to make a routine from scratch ?

    Here's a image of what i want to do :

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies