Search the Community

Showing results for tags 'js'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 109 results

  1. Phaser 3 modular JS

    Hi guys, I've looked at various git examples and I can't get my head around the whole thing. I don't have a very strong JS background so I'm struggling to split it up. Ideally I want my game structure to be: level1.js level2.js level3.js player.js items.js etc.... How do I do this??? Thanks!
  2. Hello, i have this code that should create in the create function if one of the sprites of the "asteroids" group is overlapping the station (so the player doesnt get instant killed when he spawn). It is working in the Asteroid.prototype.update function but to optimize the game i would like to check it in the create function. this.asteroids.forEach(function (item) { if (Phaser.Rectangle.intersects(this.station.getBounds(), item.getBounds())) { item.destroy(); } }, this); It isnt working as exepted, could soweone help me ?
  3. Math Pixel Puzzle

    Math pixel puzzle is a very unusual game. The rules are very simple. You will see an image with pixels of various colors. After three seconds, the pixels fly apart in 3D space. Your task is to rotate the space so that the image appears as originally. In the upper left corner you will find a hint - a small picture. You’ll need to collect an image so that it becomes exactly the same as the one in the hint. If it gets upside down or inclined – let’s look for more options to solve this puzzle. The difficulty of the levels increases at every level. In this game, we collected figures from 0 to 9 and pictures of geometric shapes: circle, square, triangle, parallelogram, cube and star. Do not spend too much time as it is limited. The faster you solve the puzzle, the more points you will get. Game Play Video Cordova Project for iOS and Android Google Play pluging GameCenter plugin Heyzap plugin (admob, UnityAds) Firebase plugin Play Math Pixel Puzzle Online Download Math Pixel Puzzle on AppStore Get Math Pixel Puzzle on Google Play
  4. How to build android and ios

    Am the beginner for phaser. I don't know how to take ANDROID and IOS build. Can anyone provide step by step guide or any link.
  5. Coding in One Week

    Check out my new video about my one week project with JavaScript and Phaser!
  6. I can't find the bugs in my code

    I have a problem: I'm making an RPG and it's not working. I just keep getting a green bar on a white screen. I have multiple .js files, and I can't figure out which file might be it.
  7. If I have multiple states (say, 30) that are somewhat resource heavy (audio, background graphic, graphics), is it better to run a single preloader at the start and preload everything I'm going to need in the game, or preload the next state ahead in each state? So if I'm in a room, and can travel to 3 other rooms from my current room, should I be preloading those 3 rooms in my current state while the player is there, etc. or preloading them all in advance?
  8. Hi everyone, // If I make grammar mistakes, please excuse me. I'm still not fluent in English ahah I'm a beginner on Phaser, had to have a look into that for my courses. I'm now upgrading a basic tutorial and I want to use a timer (a countdown) in that game but it really doesn't work, it only create a black screen. To do this, I followed this tutorial : I tried other, without success. Some were a bit to hard to understand, others were pretty ugly ! So here is the code I used , can you help me ? : var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('sky', 'assets/sky.png'); game.load.image('ground', 'assets/platform.png'); game.load.image('star', 'assets/star.png'); // on ajoute un diamant game.load.image('dmd','assets/diamond.png') game.load.spritesheet('dude', 'assets/dude.png', 32, 48); } var player; var platforms; var cursors; var stars; var diamonds; var score = 0; var scoreText; var countdown; function create() { // We're going to be using physics, so enable the Arcade Physics system game.physics.startSystem(Phaser.Physics.ARCADE); // A simple background for our game game.add.sprite(0, 0, 'sky'); // The platforms group contains the ground and the 2 ledges we can jump on platforms =; // We will enable physics for any object that is created in this group platforms.enableBody = true; // Here we create the ground. var ground = platforms.create(0, - 64, 'ground'); // Scale it to fit the width of the game (the original sprite is 400x32 in size) ground.scale.setTo(2, 2); // This stops it from falling away when you jump on it ground.body.immovable = true; // Now let's create two ledges var ledge = platforms.create(400, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-150, 250, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-100, 510, 'ground'); ledge.body.immovable = true; // The player and its settings player = game.add.sprite(32, - 150, 'dude'); // We need to enable physics on the player game.physics.arcade.enable(player); // Player physics properties. Give the little guy a slight bounce. player.body.bounce.y = 0.2; player.body.gravity.y = 350; player.body.collideWorldBounds = true; // Our two animations, walking left and right. player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); // Finally some stars to collect stars =; // We will enable physics for any star that is created in this group stars.enableBody = true; // Here we'll create 12 of them evenly spaced apart for (var i = 0; i < 10; i++) { // Create a star inside of the 'stars' group var star = stars.create(i * 70, 0, 'star'); // Let gravity do its thing star.body.gravity.y = 15; // This just gives each star a slightly random bounce value star.body.bounce.y = 0.2 + Math.random() * 0.2; } // On ajoute les diamants; diamonds.enableBody=true; // création des diamants dans l'espace de jeu for (var i = 0; i < 3; i++) { var dmd = diamonds.create(i * 70, 0, 'dmd'); dmd.body.gravity.y = 30; dmd.body.bounce.y = 0.1 + Math.random() * 0.2; } countdown.startTime = new Date(); countdown.totalTime = 120; countdown.timeElapsed = 0; countdown.createTimer(); countdown.gameTimer =, function(){ countdown.updateTimer(); }); // The score scoreText = game.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000' }); // Our controls. cursors = game.input.keyboard.createCursorKeys(); } function update() { // Collide the player and the stars (et les diamants du coup) with the platforms game.physics.arcade.collide(stars, platforms); game.physics.arcade.collide(diamonds, platforms); game.physics.arcade.collide(player, platforms); // Checks to see if the player overlaps with any of the stars, if he does call the collectStar function game.physics.arcade.overlap(player, stars, collectStar, null, this); // idem pour les diamants game.physics.arcade.overlap(player, diamonds, collectDiamonds, null, this); // Reset the players velocity (movement) player.body.velocity.x = 0; if (cursors.left.isDown) { // Move to the left player.body.velocity.x = -150;'left'); } else if (cursors.right.isDown) { // Move to the right player.body.velocity.x = 150;'right'); } else { // Stand still player.animations.stop(); player.frame = 4; } // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -350; } } function collectStar (player, star) { // Removes the star from the screen star.kill(); // Add and update the score score += 10; scoreText.text = 'Score: ' + score; } function collectDiamonds (player, dmd) { dmd.kill(); score += 50; scoreText.text = 'Score: ' + score; } function createTimer(){ var countdown = this; countdown.timeLabel =, 100, "00:00", {font: "100px Arial", fill: "#fff"}); countdown.timeLabel.anchor.setTo(0.5, 0); countdown.timeLabel.align = 'center'; } function updateTimer (){ var countdown = this; var currentTime = new Date(); var timeDifference = countdown.startTime.getTime() - currentTime.getTime(); //Time elapsed in seconds countdown.timeElapsed = Math.abs(timeDifference / 1000); //Time remaining in seconds var timeRemaining = countdown.timeElapsed; //Convert seconds into minutes and seconds var minutes = Math.floor(countdown.timeElapsed / 60); var seconds = Math.floor(countdown.timeElapsed) - (60 * minutes); //Display minutes, add a 0 to the start if less than 10 var result = (minutes < 10) ? "0" + minutes : minutes; //Display seconds, add a 0 to the start if less than 10 result += (seconds < 10) ? ":0" + seconds : ":" + seconds; countdown.timeLabel.text = result; if(countdown.timeElapsed >= countdown.totalTime){ // On cherche la fin du timer result = "Rate !"; } }
  9. Helloes. Important game points Toss up between top down rpg/adventure (snes zelda, secret of mana) with management games Should have quasy multiplayer, meaning that client deals with representation and server does everything else Procedurally generated for the most part, using tilesets or tilesections Gamepad friendly. Both X360 and DS4 How I plan to approach it Step by step, spread across mini-games and mini projects For starters, an idle game featuring the procgenned skill system Everything barebones regarding graphics untill the very end The main issues/worries I have Not sure between Cocos2d-x and PixiJS, or perhaps something else entirely, for the graphical representation What language for server side of things? Anything is fine for me, as long as its the (near)best solution I'd like to tackle the server part early on to know how to approach everything else Closing I wrote a bunch of stuff, then cut it down to bullet points as no one needs to read useless shit. I have no monetary expectations. I have an artist lined up who would do the gfx if I ever make something proper (can invest in some already done assets aswell). I do have experience modding various games and doing general coding across various languages (mini sites, apps and the like for my own amusement). I'm quick learning, adaptive and too old to have delusions of grandeur and will rather treat this as a hobby that eats a big part of my free time. Anyways, hope some of you have some suggestions and know limitations of various libraries and practices involved. I have nothing to offer in return except gratitude.
  10. From C# to JS

    Hi, I'm coming from Unity (C#), I've followed some JS tutorials, but I can't find really clear answers about OOP. Because many js online documentation talks about web developpement, I don't know if it's better to use CLASSES over PROTOTYPES in javascript game dev ? What th pros, what the cons ? (Or where can I find answers about ?)
  11. Hello, I have a form built using PHP, and need to pass the text input value to an external .js file. Here is the PHP code: <?php $brsh_size = 1; ?> <span> <div><span><center><input class = 'sp-flat' type="color" id="picker" value="#000" act="get-color" /></center></div> <center class='font-brush'>Brush Size:</a><input type="text" size="3" maxlength="3" id="br_size" act="get-brushsize" value="<?php echo $brsh_size;?>"></div></center> </span> I have a case is an external .js file where the case is called correctly: case 'get-brushsize': //var myPhpValue = $("#brsh_size").val(); //console.log(myPhpValue); //var brush_size_i = document.getElementById("br_size").value; //console.log("brush size is " + brush_size_i); break; I left some of my trial code for reference, but please ignore as I've gotten much farther with this - but run into issues. I've tried every method on stack overflow and other sites, and am unable to '_GET' the value of the PHP variable (not my first choice) but preferably the text input from the input 'id'. Any help is appreciated. Thanks, DB
  12. Mouse Hover Events

    Hey everyone! I wanted to get a bit of help getting a function working whereby when I hover my mouse over character sprites it will show a there name and title just above the mouse position for each different sprite, I'm unsure if I need to look at going down the route of a mouse hover/mouse over function or i need to create an event listener. If anyone could make a demo that I could play with and learn from or something that would be perfect! Thanks guys! Mezz
  13. When i am drawing any sprite usign pixi its looking blurry on both mobile (android mobile ) and pc (chrome browser) Then i tried setting (roundPixels: true). Then it becomes sharp on pc but still blurry on mobile devices. I have looked at forums but could n't get any help. I tried looking on stackOverFlow but i got nothing which could actually resolve my problem. I have used below code. var gs = {width:950,height:640}; var app = new PIXI.Application(gs.width, gs.height, { resolution: 1, antialias: false, forceFXAA: false, forceCanvas: false, autoResize: true, transparent: false, backgroundColor: 0x000000, clearBeforeRender: true, preserveDrawingBuffer: false, roundPixels: false }); var down = PIXI.Sprite.fromImage("images/icon.png"); down.anchor.set(0, 0); down.position.set(100, 150); app.stage.addChild(down); Please help.
  14. Remove SpriteSheet TextureCache

    I have loaded SpriteSheet using json. Like this below. const loader = new PIXI.loaders.Loader(); loader.add('bunny', 'data/bunny.png') .add('spaceship', 'assets/spritesheet.json'); loader.load((loader, resources) => { }); I want to remove all the TextureCache which was loaded using this spritesheet.json only. I have tried. PIXI.Texture.removeFromCache("spaceship"); PIXI.Texture.removeTextureFromCache("spaceship"); But in PIXI.TextureCache names of all the spriteFrame were included there. And still i am able to use image form frame. Using this. var bgSprite2 = PIXI.Sprite.fromFrame("ship1"); bgSprite2.anchor.set(0.5, 0.5); var pos = {x: 300, y: 200}; bgSprite2.position.set(pos.x, pos.y); stage.addChild(bgSprite2); I want to remove all the entries of spriteFrame in TextureCache and i want to load new set of spriteFrame. I am doing this because i have spritesheet animations of two diffrent spaceship but the individual symbol name of both spaceship are same. Please help.
  15. Part 7 is here, concluding our series: Check out the demo: Thanks for the support throughout the series! Let me know if you want to see more tutorials like these ones.
  16. In the game "Monster Wants Candy," I see this in the source code, and I was wondering why this was done. I've tried doing this myself but keep failing. This is what I mean: var Candy = {}; Candy.Boot = function(game){}; Candy.Boot.prototype = { preload: function(){ // preload the loading indicator first before anything else this.load.image('preloaderBar', 'img/loading-bar.png'); }, create: function(){ // set scale options this.input.maxPointers = 1; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true); // start the Preloader state this.state.start('Preloader'); } }; (source: var gameWidth = 800, gameHeight = 600; var game = new Phaser.Game(gameWidth, gameHeight, Phaser.AUTO), BootState = function () {}, gameOptions = { playSound: true, playMusic: true }, musicPlayer; BootState.prototype = { preload: function () {'loadingbar', 'assets/images/loadingbar.png');'logo', 'assets/images/logo2.png');'LoadState', 'js/gamestates/LoadState.js');'pollyfill', 'js/lib/pollyfill.js');'utils', 'js/lib/utils.js'); }, create: function () { game.renderer.renderSession.roundPixels = true; Phaser.Canvas.setImageRenderingCrisp(;'LoadState', LoadState);'LoadState'); } };'BootState', BootState);"BootState"); I also note that I don't take "Game" as an argument in my game state functions, unlike Monster Wants Candy which has the argument "game" in it's bootstate. Have I been doing something wrong? I'm following most of the tutorials and example code I've seen so far, though I am aware those may not always be good examples of best practice. Thanks in advance for replies and sorry for the long post. I'm a bit of a JS and Phaser noob, I'm mainly just aiming to learn good practice with this project.
  17. Part 6 of my tutorial series on making is here! Check out the demo: Enjoy!
  18. Part 5 of our series has arrived: Also check out the demo for this part: In this part you will learn how to add those awesome eyes to your snakes!
  19. Hey, Everyone I'm dying making attempts to scale canvas for high dpi mobiles and get everything work correctly. Problem: When I start Phaser with 100% width/height for canvas it will be created according to css pixel size of device (window.innerWidth/innerHeight). So iPhone 6S for example, gets, 375x667 canvas, but in fact, of course it should be 2x bigger because devicePixelRatio is 2. Result, everything is blurry and not as expected. Ok, I decided to set width and height with devicePixelRatio included and then set CSS size of canvas to 100% of view port. let w = window.innerWidth * window.devicePixelRatio; let h = window.innerHeight * window.devicePixelRatio; let game = new Game(w, h) // And then in style sheet: canvas { width: 100vw !important; height: 100vh !important; } Now, it seems like everything looks perfect and as expected (is it correct way to do it?). But, another problem rises. Seems like after this events.onInputDown do not work correctly. When I click on sprite nothing happens, but in different location click handled. Seems like coordinates of input arena is messed up. Can someone help me this this?
  20. I'm trying to move a canvas object towards a onmousedown position, which gets sent from a user to the server. But my problem is the following: The object on the canvas is only moving a little step towards the delivered position. There must be a problem which could be caused by the dest calculation. Youtube video which shows my problem: A jsfiddle with a working example: Code which sends the position from the user to the server and which draws each user on the canvas: <script type="text/javascript"> var ctx = document.getElementById("ctx").getContext("2d"); ctx.canvas.width = window.innerWidth; ctx.canvas.height = window.innerHeight - 142; var socket = io(); socket.on('newPositions', function(data) { ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); ctx.fillStyle = "rgb(255,0,0)"; ctx.beginPath(); for(var i = 0; i < data.length; i++){ ctx.arc(data[i].x, data[i].y, 10, 0, Math.PI * 2); } ctx.closePath(); ctx.fill(); }); document.onmousedown = function(event) { socket.emit('positionUpdate', {x: event.pageX - ctx.canvas.offsetLeft, y: event.pageY - ctx.canvas.offsetTop, state: true}); } document.onmouseup = function(event) { socket.emit('positionUpdate', {x: event.pageX - ctx.canvas.offsetLeft, y: event.pageY - ctx.canvas.offsetTop, state: false}); } </script> Part of the app.js code which contains the current position update code var serv = require('http').Server(app); var SOCKET_LIST = []; var PLAYER_LIST = []; var Player = function(id, x, y){ var self = { x: 100, y: 100, id: id, number: "" + Math.floor(10 * Math.random()), mouseMovement: false, maxSpd: 5, radius: 10 } self.updatePosition = function(x, y) { if(self.mouseMovement){ // Problem movement var targetX = x; var targetY = y; var tx = targetX - self.x; var ty = targetY - self.y; var dist = Math.sqrt(tx * tx + ty * ty); var velX = (tx / dist) * self.maxSpd; var velY = (ty / dist) * self.maxSpd; if (dist > self.radius / 2) { self.x += velX; self.y += velY; } // Problem movement end } } return self; } var io = require('')(serv, {}); io.sockets.on('connection', function(socket){ console.log('socket connection'); = Math.random(); SOCKET_LIST[] = socket; var player = Player(; PLAYER_LIST[] = player; socket.on('disconnect', function(){ delete SOCKET_LIST[]; delete PLAYER_LIST[]; }); socket.on('positionUpdate', function(data){ player.mouseMovement = data.state; player.updatePosition(data.x, data.y); }); }); setInterval(function(){ var pack = []; for(var i in PLAYER_LIST){ var player = PLAYER_LIST[i]; player.updatePosition(); pack.push({ x:player.x, y:player.y, number:player.number }); } for(var i in SOCKET_LIST){ var socket = SOCKET_LIST[i]; socket.emit('newPositions', pack); } }, 1000/30); Explaination: The following code sends the target position to the server: document.onmousedown = function(event) { socket.emit('positionUpdate', {x: event.pageX - ctx.canvas.offsetLeft, y: event.pageY -ctx.canvas.offsetTop, state: true}); } Then the following code will be triggered: socket.on('positionUpdate', function(data){ player.mouseMovement = data.state; player.updatePosition(data.x, data.y); }); Which will set the player.mouseMovement to true and delivers the targeted x and y cordinates to the player.updatePosition function: self.updatePosition = function(x, y) { if(self.mouseMovement){ // Problem movement var targetX = x; var targetY = y; var tx = targetX - self.x; var ty = targetY - self.y; var dist = Math.sqrt(tx * tx + ty * ty); var velX = (tx / dist) * self.maxSpd; var velY = (ty / dist) * self.maxSpd; if (dist > self.radius / 2) { self.x += velX; self.y += velY; } // Problem movement end } } I would appreciate any kind of help or suggestions.
  21. Well I don't know what I am doing wrong anymore, and its keeping me up at nights! So if you are a kind soul out there, please, please help me correct my erroneous ways Here is my index.html file: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title> Tutorial Endless Runner RPG </title> <script src="phaser.min.js" type="text-javascript"></script> <script src="boot.js" type="text-javascript"></script> <script src="preloader.js" type="text-javascript"></script> <script src="level001.js" type="text-javascript"></script> </head> <body> <script type="text-javascript"> window.onload = function () { var game = new Phaser.Game(800, 600, Phaser.AUTO, ''); game.state.add('Boot', Game.Boot); game.state.add('Preload', Game.Preloader); game.state.add('Level001', Game.Level001); game.state.start('Boot'); }; </script> </body> </html> The boot and preloader is pretty much empty, on create they boot the next game state. Which leads up to Level001, where I set the background color to some grey blueish color. However, when I run the application (index.html) through xampp, I get nothing, not a squat. The problem with nothing is that it doesn't even display any sort of errors, which I in-turn interpret as some sort of linker error, like a null pointer or what not that is just fine with running because if there is null send somewhere, it doesn't do anything to begin with. I've tried to move my files, changing the script src, I've tried rewrite my code, I followed guides, red others downfall, yet nothing so far has shed light upon the dank and gloomy code that I've written. I am all out of aces, yet the battle hasn't even begun. Please let me have a fighting chance in this havoc
  22. Hi guys, I have more info about the game coming soon but would like to start getting help from more people in terms of testing. I'm looking for any flaws here, errors, game play issues, bugs. Some I am aware of from prior testing and still have yet to figure out and resolve although the game should allow you to play through. The game is a simplistic simulator which allows you to build your own arcade, the walls, the machines, the floors, everything. If you've played prison architect or Rimworld you'll probably see the resemblance which I drew inspiration from. The game is planned to work in any browser and any mobile tablet. Sadly a phone version may just be too far away/complex to achieve. At current the game lets you start the tutorial and then continue to play through on the tutorial level. You can pan the camera with W A S D or by touching the edges. [update] Latest Version here: All feedback appreciated, thanks guys. Jammy
  23. Hi, I've always enjoyed open world games, rpgs and adventures, and I always thought that a open world game using real world locations would be a great idea, mainly because I love to spend time with google maps just looking at how different places look. After some years thinking about it I finally have something I'm more or less happy with: real world locations, missions, turn-based fights and informal dialogues. I've reached a point where I need feedback about what I've coded until now, I think it is a good idea but I don't know what others think. I would be happy to hear any feedback you have about the game or what you think it would need to be implemented so it could be considered a game is worth investing time on it. It is fully playable using a web browser, responsive to mobile / tablet / desktop, just HTML and JS, no backend yet. You can play the game in, the game's website is its github page, it is coded as an engine on top of google maps JS APIs and Phaser that allow different stories, sharing the fights and points of interest systems. The game I've linked to is a story I thought would be catchy to start with. Thanks in advance for your feedback.
  24. Inheritance(?) in js question

    Hi, I have been going through a tutorial on recreating FruitNinja (unimportant maybe). I am a beginner in JS with experiance in Java. I need some help or reference where to get it - I have 2 states like this: var FruitNinja = FruitNinja || {}; FruitNinja.JSONLevelState = function () { "use strict";; }; FruitNinja.JSONLevelState.prototype = Object.create(Phaser.State.prototype); FruitNinja.JSONLevelState.prototype.constructor = FruitNinja.JSONLevelState; (...) FruitNinja.JSONLevelState.prototype.create = function () { this.create_prefab(prefab_name, this.level_data.prefabs[prefab_name]); }; FruitNinja.JSONLevelState.prototype.create_prefab = function (prefab_name, prefab_data) { if (this.prefab_classes.hasOwnProperty(prefab_data.type)) { do stuff... }; (...) and var FruitNinja = FruitNinja || {}; FruitNinja.LevelState = function () { "use strict";; this.prefab_classes = { "background": FruitNinja.Prefab.prototype.constructor, (...) }; }; FruitNinja.LevelState.prototype = Object.create(FruitNinja.JSONLevelState.prototype); FruitNinja.LevelState.prototype.constructor = FruitNinja.LevelState; FruitNinja.LevelState.prototype.create = function () { "use strict";; (...) } Somehow JSONLevelState can access LevelState this.prefab_classe object. I don't understand how. Can I somehow print it to chrome console? Or can someone explain it or point me to some external reference ? I have watched couple of videos on youtube on inheritance in JS but I still don't get it. Please help, Ok Solved. ";" allows dunc from JSONLevelState be called in LevelState object (having access to its variables. Watch for a complete explanation.
  25. Hi folks, Babylon.js/game dev n00b here. I've started attempting to make a real-time strategy game, similar to Red Alert or Starcraft. So far, I have a bunch of blocks you can create and move around a flat map. I'm just posting this here so I could get your feedback, or suggestions, am I doing anything obviously wrong? Cheers, Ewan