Wolfsbane

Members
  • Content Count

    142
  • Joined

  • Last visited

  • Days Won

    1

Wolfsbane last won the day on September 12

Wolfsbane had the most liked content!

About Wolfsbane

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi @Beny , If this is absolutely your first dive into making a game, I'd actually recommend maybe reading a book like Game Programming Patterns. ( The web version is completely free). It'll give you a better idea of the typical game life cycle, and you can adapt your PHP skills to design better for a game. The book is language agnostic.. so you can use the knowledge with any language. I know it's nothing to do with javascript, or babylon,js, or creating graphics.. but I'd definitely recommend reading this as one of your baby-steps towards your first game!
  2. Wolfsbane

    Classic Space Adventure

    Oh, come on, man, it's the first sentence in the game! ๐Ÿ˜ (Sorry.. it's obligatory to give a game dev a hard-time for typo's.. we all do it. ๐Ÿ˜Š. Game looks really good, did you do the graphics yourself?)
  3. Wolfsbane

    importing an external JS file

    There's one on the main website: https://www.panda2.io/tutorials/module
  4. Wolfsbane

    How secure is the game storage API ?

    I'm interested. Let us know how it goes!
  5. Wolfsbane

    [Phaser 3] Chase of Boxes

    For feedback, I'd say have a think about making a crawling up ladder sprite. Just using the same jumping sprite looks a bit weird. I'm not sure about the graphics in general. Some parts I like (the character sprite) but some of the other game graphics don't seem to quite blend well together. But otherwise, the game design is really solid, I like!
  6. Wolfsbane

    Battleship - raw HTML game

    I feel like having single square ships is a mistake. Part of the decision making in battleships is judging the likelihood of where a ship might be... meaning you can try different shot patterns, and skip certain squares/corners, because you know it won't fit there. Now it's just blind luck with one square ships. Otherwise, works well. If this was made as a challenge, how long did it take to make, may I ask?
  7. Wolfsbane

    App Store Idea

    Oh I don't know. Maybe the marketing team of local business could login and check who's nearby, and what games they've made? So they can easily contact someone and get something customized for their business. I think most small businesses try hard to market via social media/marketing, and I think games would be a great way to boost the image.. and (small) web games are honestly relatively cheap, and HTML5 games can go just about anywhere thesedays (App, facebook, web, etc). I think most non-techy's are cautious about using off-shore resources, and a bit ignorant of the potential, but a local dev who can roll in, see the business, explain where it can go, and adapt an old design for $1-$3k within a week could be pretty tempting.
  8. Hmm, good point. So I took a closer look at the code. I'm not sure if it's a bug still, but it's unclear behavior (so maybe a bit bug-ish?) So in input.js, we have: /** @method _processEvent @param {String} eventName @param {MouseEvent|TouchEvent} event @return {Object} item @private **/ _processEvent: function(eventName, event) { for (var i = this.items.length - 1; i >= 0; i--) { var item = this.items[i]; if (!item._interactive || !item.visible) continue; if (this._hitTest(item, event.canvasX, event.canvasY)) { if (!item[eventName](event.canvasX, event.canvasY, event.identifier, event)) { return item; } } } }, And it actually *does* a visibility check. The issue here seems to be: The graphics item is the one that is interactive, and that is still visible=true (but the container it's in is visible=false). I guess if you set the container visible= false, it doesn't draw it's children anymore, but it *doesn't* update all it's children to be visible = false, too. So as far as the mouse click event is concerned, the graphic item is still interactive, and still visible. I don't... know if this is a bug. It's definitely a bit unexpected. The quick fix in your scenario is to make the graphic itself visible = false. Just put an extra function on the container, and make it when it sets itself visible/invisible, it sets it's children visible/invisible, too. I will say that the interactive hand cursor position is bugging a bit in your example you posted. E.g. it highlight from from 0,0,200,200, which is not correct (it should only be from 100,100). If we change the drawing to be like this: game.module( 'game.main' ) .body(() => { game.createScene('Main', { init: function() { var container = new game.Container(); container.addTo(this.stage); var graphics = new game.Graphics(); graphics.drawRect(0, 0, 100, 100); graphics.position.set(100,100); graphics.interactive = true; //graphics.visible = false; graphics.buttonMode = true; graphics.addTo(container); container.visible = false; } }); }); The hand cursor highlight 0,0,100,100. If you make the container visible, it highlights 100,100,200,200. This is odd, and not correct. Well, as per the _processEvent code above, it's just that the first interactive object consumes the mouse click. You could change this, if required. I don't think there is a way currently in the Panda Engine to make 2 items stacked on top of each other both process a mouse click event. (But I might be wrong..!)
  9. Aah, I see. I think that's fine. (feature, not a bug). If I have a big, single image, I might want to add a whole bunch of different, 'invisible' clickable areas on it, that do different functions. The issue of the top (invisible) layer blocking the bottom (visible?) layer, you can work around by sorting the layers. E.g. with the layer you want to be clicked, or 'ontop', you can use: container.toTop(); Enpu made a post here, describing how you could go about sorting a whole bunch of different layers, etc, to get them on top.
  10. Wolfsbane

    What is the Best Way to create start menu?

    I'd take a look at the essentials plugin, and see how it's built. The docs for it describe the API: If you look at your code, you'll see that you're essentially doing this for each menu button. You're 1: creating it with an asset( in your case, Text), 2: setting the x/y coordinates, and 3: setting up a callback method with an action. (In your case: goto scene X/Y/Z) So you don't have to create so much 'code' in your scene's init, you could write something like: this.StartGame = new game.Button('Start Game', game.width/2, game.height/2, function() {game.system.setScene('Stage1'}); this.HowToPlay = new game.Button('How to Play', game.width/2, game.height/2+150, function() {game.system.setScene('HowToPlay'}); this.ExitGame = new game.Button('Exit', game.width/2, game.height/2+150, function() {game.system.setScene('Exit'}); Now for your arrow code: Tough to say, there's a hundred ways to skin a cat. Maybe one way could be to store the list of buttons as a list(array). and when you move up/down, you simply change 'target', and update x/y. E.g. game.createClass('Arrow_Select', { init: function(x, y, buttonList) { this.buttonList = buttonList; this.target = 0; //0 = first element in list. this.arrow_select = new game.Sprite('select_arrow.png'); this.arrow_select.selectTime = true; this.arrow_select.anchorCenter(); this.setXY(); //see new helper function below. }, setXY: function() { this.arrow_select.position.set(this.buttonList[target].position.x, this.buttonList[target].position.y); }, reset: function() { if (!this.arrow_select.selectTime) { game.Timer.add(500, function() { game.scene.arrow_select.arrow_select.selectTime = true; }); } }, update: function() { if (game.keyboard.down('UP') && this.arrow_select.selectTime) { this.target -= 1; if (this.target < 0 ) { this.target = this.buttonList.length-1; } } else if (game.keyboard.down('DOWN') && this.arrow_select.selectTime) { this.target += 1; if ( this.target >= this.buttonList.length) { this.target = 0; } } //update position this.setXY(); if (game.keyboard.down('ENTER')) { this.buttonList[target].doButtonAction(); // Arrow Object shouldn't care what this action is. It should be coded in the button. } } }); (gosh.. this code editor is horrendous for formatting... ) Does this way make sense? A little less hardcoded? This way the arrow object doesn't know about the x/y coordinates, and it doesn't even know what action it's meant to take on object. That's all still stored in the button object.
  11. Wolfsbane

    How secure is the game storage API ?

    Not really a web dev, but...I'd assume so. I took a quick peek at the Panda js for storage, and there's nothing about encryption. You might be able to add some basic scrambling of the data? But I think since the the javascript is all opensource, and their local storage is right there, if they really want to, they can change stuff.
  12. Wolfsbane

    importing an external JS file

    Like loading it as a plugin?
  13. ? I haven' worked with views, so I don't have an opinion on it, but I'm curious to see it. Do you have a sample project you can upload so I can take a peak? You're good. I'm not sure about others, but I read 'em. I'd reply more, but some of the topics I just have no experience in (*yet*).
  14. Wolfsbane

    Best game engine with editor

    I use the Panda2 editor. The engine is open-source, which is a really big advantage for me personally over something like Construct. The editor itself is commercial, and I'm pretty happy with it.
  15. Wolfsbane

    DEL

    What happened to this topic? ๐Ÿ˜„