R0J0hound's Recent Forum Activity

  • Here is the topic that zenox98 is talking about.

    http://www.scirra.com/forum/viewtopic.php?f=3&t=7670&hilit=mapeditor

  • [quote:1iw8l0zl]Is it possible to access a "Box" object's private variables from Python?

    No, not directly. A recompile of Box.csx would probably fix it so it uses the updated code that Sprite uses.

    A current solution is to use a hybrid event/python approach by setting a python variable to one of the box private variables with the "Run Script" System action.

    + System: Start of layout

    -> System: Run Script ("foo=" & Box.Value('foo'))

  • You can hide other windows with python with the ctypes library and the winapi reference. In particular the ShowWindow function should do the trick.

    Example that hides any window for 5 seconds:

    http://dl.dropbox.com/u/5426011/examples4/windowhide.zip made in 0.99.97

  • [quote:2mya6rua]Is it possible to access private variables from Python?

    Yep, exactly the way you posted. If the variable name you use does not match any of the Sprite's private variables NULL will be returned.

  • Tokinsom beat me to it, but here's another example:

    http://dl.dropbox.com/u/5426011/examples4/randomname.cap made in 0.99.97

  • By reversing the actions in event 32 fine changes of movement aren't remembered. In which case unlimited framerate will not work because any small changes in motion will be rounded out, so the object won't move. One thing you could try is use "int" instead of "round" and see if that reduces the jagginess.

  • [quote:1hdneyrp]Problem 1 is the player will occasionally land a pixel or 2 inside of the platform.

    One solution would be to not use "Custom Movement" and just move the Sprite manually.

    Use "overlapping at offset" to check if it will collide after the next move. If it doesn't, move it. If it does then do a loop moving 1 pixel at a time in the direction of motion until it is right against the obstacle.

    [quote:1hdneyrp]Also, you will see in event 2 that I round the player's x and y positions every tick. I did this because it results in smoother movements and scrolling, and is essential with such a small resolution. Problem is, now the player won't move at all when I use unlimited framerate mode.

    Unlimited framerate makes tiny steps in position, which end up getting rounded away every tick.

    For example.

    say Player's X is 100 and horizontal speed is 50 pixels/sec.

    newposition = oldposition + speed * time

    Vsync 60 fps, time=1/60 sec

    newposition = 100 + 50 * 1/60

    =100.83 which rounds to 101

    Unlimited ~ 900 fps, time=1/900 sec

    newposition = 100 + 50 * 1/900

    =100.05 which rounds to 100. No motion.

    Here is your cap modified with a no behavior approach:

    http://dl.dropbox.com/u/5426011/examples4/nobehavior%20platform.cap made in 0.99.97

  • The "OR" condition can cause crashes in some situations.

    There are 4 places where you are using OR that is causing the crash on restart.

    event sheet: Mario Movement2

    group: Items

    event 111

    group: enemies\mario damage

    event 30

    event sheet: Mario Movement

    group: ground

    events 14,108

    If you disable those events it won't crash anymore. You'll have to rework those events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For "On Control Released" an inverted "control is down" condition with a "trigger once" should work.

    "On Any Control pressed" has to be done manually by checking each one.

  • Experimental cap to C2 converter alpha

    It takes a cap file saved in 0.99.96 or later and try's to convert as much as possible to a Construct 2 (build 30) project. There are many differences between Construct 0.x and Construct 2, so only features common to both can be converted. Anything else will just be ignored.

    It's alpha because I haven't tested it with that many cap files, so there is probably many unsupported cases that will cause a crash.

    Objects converted:

    Sprite, Text and Mouse&Keyboard.

    Download:

    http://dl.dropbox.com/u/5426011/utility/capConverterAlpha1.zip

  • When you use "Autoplay resource" the resource will be assigned to the next free channel. You are only stopping channel 1. A solution would be to use "load resource" to assign the sound to channel 1.

    EDIT:

    Here's an example for a more correct pacman movement.

    http://dl.dropbox.com/u/5426011/examples4/pacman.cap made in 0.99.97.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound