Pete's Recent Forum Activity

  • thank you very much <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

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

    i created an enemy that is walking left and right and should fire a projectile if the player gets too close.

    the movement of the enemy is controlled by a boolean called "w_left", that toggles if the enemy collides with a sprite called "turn". as long as w_left is true the enemy walkes to the left and if it is false he walkes to the right.

    if the enemy is walking to the left (w_left is true) and the player is less than 200px away (enemy.x <= player.x + 200) it should fire a shot. i did the same accordingly for the other side.

    if the enemy is walking towards the player everything works smoothly, but if the enemy turns around and faces the other direction it is shooting constanly.

    i tried to cover all possible states that could occur but i was not able to figure it out. this drives me mad, i hope someone can help me.

    game

    file

    controls are:

    left - A

    right - D

    jump - L

    the black thing around the enemy should symbolise the range.

    thanks in advance

  • you could try the event: "Is overlapping another object".

    the laser would go from your player to infinity, but it will recognise if something is in the way. if i understand your problem correctly this is allready the solution to your problem. you don't need to calculate the distance.

    if you need the distance, you need the x and y coordinates of the object your laser is crossing and calculate the difference to the player.

    !! i hope that i don't write nonsense

    let's say the player is at:

    x = 100

    y = 100

    and the enemy or obstacle ist at:

    x = 215

    y = 312

    now you have to do some math:

    at first you calculate the difference between the x and y coordinates

    215 - 100 = 115

    312 - 110 = 212

    now you need our good friend pythagoras

    en.wikipedia.org/wiki/Pythagoras

    calculate the square root of (115^2 + 212^2)

    the solution to this is 241,18

    _______________

    \|(115^2 + 212^2)

    edit:

    so much for my ascii art <img src="smileys/smiley1.gif" border="0" align="middle" />

  • no, i tried it quite often.

    it's probably just my windows, it worked before i reinstalled it.

  • hello i stumbled across a strange behaviour.

    if i change something in the layout "level_1" (like moving a sprite) and want to save, the program crashes, but only when the layout is aktive. if i change something in the layout "level_1", switch to an eventsheet and hit save, everything works.

    i can also save changes in different layouts, while they are open, aswell as changes in eventsheets.

    sometimes (i don't know how it is triggered) this error message appears (it's a windows dialog):

    ---------------------------------------------------------

    Problem signature:

    Problem Event Name:     BEX64

    Application Name:     Construct2.exe

    Application Version:     2.0.0.0

    Application Timestamp:     4e6cfe9b

    Fault Module Name:     StackHash_f68e

    Fault Module Version:     0.0.0.0

    Fault Module Timestamp:     00000000

    Exception Offset:     0000000002b303d0

    Exception Code:     c0000005

    Exception Data:     0000000000000008

    OS Version:     6.0.6001.2.1.0.256.4

    Locale ID:     3079

    Additional Information 1:     f68e

    Additional Information 2:     84f4d361dd04528a2f4c41de09af49a8

    Additional Information 3:     ad86

    Additional Information 4:     7f1a285b17ff6afc1721eec9e9d097fc

    Read our privacy statement:

    go.microsoft.com/fwlink

    ---------------------------------------------------------

    files

    edit:

    i use windows vista enterprise service pack 1

    and nvidia 8400GS with latest driver

  • i did something similar, but i'm not sure if my solution is perfect.

    i looked at the weapons as numbers.

    1 = first weapon

    2 = second ......

    3 = third .....

    if the next weapon is selected a variable called "current" would increment by one. selecting the previous weapon would decrement "current".

    if the player would press the key to use the weapon it would check the value of "current" and if it is 2 the shot of the second weapon would be fired and so on.

    i hope this helps you a bit.

  • that's really great. i tried this with logic blocks, but it was a mess. thanks for posting your work.

    but you should change the first line in the "License.txt" ;)

  • Just copy the layout.xml and the layout.uistate.xml

    change the names of the files to whatever you want. (for example to layout2.xml and layout2.uistate.xml)

    open the new layout2.xml and change the name of the layout in the third line:

    <?xml version="1.0" encoding="utf-8" ?>

    <c2layout>

        <name>layout2</name>

    open the project.caproj with the a text editor and add the following line:

    (scroll to the end of the file to find this part.)

    <layout-folder expanded="1">

        <layout>layout.xml</layout>

        <layout>layout2.xml</layout>

    </layout-folder>

  • god dammit... usually i would do that, but i was waiting for moneybookers to be available and didn't want to deal with the limitations of the freeware version.

    but it's not too bad. i'm glad that it's only the layout that got killed. i edited an older project file so that it contains all the sprites i added and the eventsheets are fine too.

    keeping everything so nicely seperated was a wise choice!

  • of course (i should have thought about that).

    shoveldoody.oxymoron.ismywebsite.com/nerd%20neu.7z

    after the initial shock i checked the other files and the level_1.xml (this is a layout) is also busted. it looks like my comupter crashed during the saving process, or more likely just the program. i don't recall any incidents like that, everything went smoothly the last time i worked on it.

    i also want to apologise for my scatterbrained post.

  • everytime i try to open my construct project it shows an error message: error document empty.

    is it possible to solve this problem or is my file destroyed?

    i use construct r50.

    built-in image editor

    tilemap support

    families

Pete's avatar

Pete

Member since 22 Aug, 2011

None one is following Pete yet!

Trophy Case

  • 13-Year Club

Progress

13/44
How to earn trophies