Tig0r's Forum Posts

  • 8 posts
  • Hi everybody,

    I have written a silly Christmas game with a high score table. The game is at http://tig0r.com/sendsantapacking.

    From here the high-score table works fine.

    I've published the game to the Scirra arcade https://www.scirra.com/arcade/action-games/send-santa-packing-13497). However... the high-score table doesn't work (which of course I also found whilst testing on localhost and had to upload the game to the website for it to work).

    So... of course I need to enable cross domain scripting.

    Ideally I imagine I want to add this to the top of my .php file -

    <?

    header('Access-Control-Allow-Origin: https://www.scirra.com');

    ..

    ...which doesn't work. Worse still I can't even make this work!!

    <?

    header('Access-Control-Allow-Origin: *');

    ..

    I've read about a billion articles and they all say the same thing.

    So what am I missing?!!

    Server is Apache.

    Many thanks to anybody who can tell me what I've got wrong here! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Hi all,

    I released my Christmas game last night, and today I'm receiving reports that the high score table (or to be more precise the text box allowing you to enter your name) doesn't work on Internet Explorer.

    I've tested it and it seems to work fine in all browsers - including IE10 - but not IE11.

    The game is here - christmas.gmlnt.com.

    When you've lost all your lives you will see an "enter your name" text box, but you can't type anything under IE11.

    I assume this is a bug and needs posting in the bug forum, but as the game is out in the wild already I'm hoping somebody might have a quick fix for this, hence why I'm posting here. Otherwise I'll report it as a bug, but if anybody can help, that would be much appreciated! :)

    Thanks!

  • Morning all!

    I must be doing something wrong, but I can't seem to be able to resize an image upon placing it on the screen!

    <img src="http://tig0r.com/frantic_html5/set_image_height_width_problem.jpg" border="0" />

    This code follows a bullet hitting an enemy ship. Everything works correctly in that the explosion is created (and elsewhere it is destroyed after time), but I can't seem to set the width and height of the explosion to match the enemy ship - it just appears at the size it's set to within the image editor.

    So I eliminated the possibility of the enemy ship being the problem, and changed the code so it should resize the image to a random width / height as it is created, but it still gets created at the same size it's set to within the image editor!!

    Can anybody see what am I missing?!!

    Thanks! :)

  • Tobye you make an excellent point, I had completely overlooked that! I've changed it to use an instance variable which I set when pacman eats a ghost. The pathfinding routine is then called, and I reset the instance var at the end of that block of code, so it's definately only being called once now.

    I tried setting the cell sizes right down and whilst it didn't fix it, the ghosts did move fractionally, so I knew I was along the right lines.

    I tinkered with the settings, and eventually came up with a working combination (more-or-less!) of a cell size of 32 (which is my tile size), and a cell border of -1.

    (I say more-or-less as the ghosts do tend to skim the corners, but hey, they're ghosts trying to get back home as fast as they can! :)

    Anyway thanks very much for your help, Tobye and tulamide, I doubt I would have got there without you! :)

  • Thanks tulamide and Tobye for the replies.

    The "add obstacle" is used only "on start of layout".

    The reason I added the "is calculating path (inverted)" at line 66 was because I was unable to run the code from within a sub-event (I got a message at runtime saying the GUI will prevent this in the future!), so I had to add my code on the root path. For this reason I figured it was prudent to add the "is calculating path (inverted)" or it would continously re-initiate the "calculate path" code and never actually allow it to finish!

    But thanks to your replies I set a text output on "On pathfinding failed to find path" and that's exactly the problem - it can't find a path, so it was continously re-running the pathfinding routine, and giving the impression it was always running but never finding a path.

    So my next question has to be... why can it not find a path?! I've only added the walls as obstacles, so it should seemingly be able to calculate a route from anywhere within the grid to the "GhostHome.X,GhostHome.Y" position, which is in the centre of the screen. From what I've read if it couldn't find a path because the home location was blocked off then it should pick the nearest spot instead.

    Aside from the pathfinding behaviour the ghost just has a bullet behaviour, which I disabled before I started the pathfinding routine in case this would affect it.

    Am I right in thinking it should be able to find a path? What am I missing?! 8 direction movement maybe, or some other pre-requisite? I tried making the GhostHome sprite visible as well, in case it has to be visible for the pathfinding to work, but that didn't help :(

    Thanks again! :)

  • Morning all!

    I'm still playing PacMan, and one of the things I'm still having problems with is the ghosts finding the quickest route home once they've been eaten (without just passing through the walls!)

    So I thought I'd try the pathfinding behaviour.

    I've been through the manual and any tutorials I could find, but it simply won't calculate a path. It just sits there calculating it but never finds a path, and never fails to find a path either!

    Here are my initial settings, the two lines of code that run at start of layout, and finally the events to kick off the pathfinding, followed by two events to handle the path found, or to re-run the pathfinding if it doesn't find a route home.

    <img src="http://tig0r.com/pacman/pathfinding.jpg" border="0">

    Any ideas what I'm missing here? The manual says it might take a fraction of a second to find a path, but I can go and make coffee and it's still working on it when I get back... something must be wrong!

    The game so far is here if anybody wants a look! :)

    Ta!

  • cvp

    Thanks cvp (and also burningcake), that's exactly what I was missing.

    I'll try and be less wordy next time! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Morning all!

    I've just completed the jungle platform game tutorial and I have a general collision detection question.

    The tutorial provides a sprite sheet of 144 sprites, which are all different sizes, and says to use a size of 128x128.

    When I use a half-height tile, the collosion poly is the full 128x128 (including the white space), whereas obviously I only want it to be the size of the graphic.

    So first I created a second solid tile object, and made a separate tile object for the smaller sprites. This actually worked fine, and solved my problem.

    But then I figured... surely that can't be right, I must be missing something!

    So I went back through the tutorial, and I tried SHIFT + crop transparant edges - even though the tutorial didn't say to do that - and on the face of it (within Construct 2) this seems to have done the trick.

    But when I render the game, whilst the collision poly is now the right size, the sprites have been squashed to half height, so I again have the collision detection problem, plus squashed graphics!

    So I've gone back to making a second tile... but that means all the sprites in the sprite sheet that are less than the full size are unusable, and this seems very inefficient.

    So I figure I must be missing something fairly essential, which doesn't suprise me as I'm only two tutorials in!

    I've had a quick look at all the platform examples but they don't seem to use sprite sheets, and I can't find a .capx file for the jungle platform game.

    So... what am I missing here?! :)

    Thanks!

  • 8 posts