Jump to content

Search the Community

Showing results for tags 'html5 phaser canvas css'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello. Im totally new to Phaser HTML5 and CSS. I have basic html knowledge and a decent background in java programming, I only have limited knowledge about javascript. I wrote following simple html5 page showing a bouncing sprite using Phaser. http://oddskill.bplaced.net/bouncingcow/index.html Why is the "a href" in the index.html (the link to the zipped sourcecode) shown above the Phaser canvas? I did place the call to the javascript (which creates the canvas if i understood that right) below that "a href". Any help would be appreciated. Best regards. Chris PS: sourcecode below index.thml <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Bouncing Cow</title> <link rel="stylesheet" href="css/style.css"> <script type="text/javascript" src="js/phaser.min.js"></script> </head> <body> <h1>BOUNCING COW<h1> <script type="text/javascript" src="js/bouncingcow.js"></script> <a href="bouncingcow.zip">sourcecode</a> </body></html>bouncingcow.js var game = new Phaser.Game(500, 500, Phaser.CANVAS, '', { preload: preload, create: create, update: update });var img;function preload() { game.load.image('cow', './assets/cow2_bg_white.png');}function create() { game.stage.backgroundColor = '#00ff00'; game.physics.startSystem(Phaser.Physics.ARCADE); img = game.add.sprite(20, 20, 'cow'); game.physics.enable(img, Phaser.Physics.ARCADE); img.body.velocity.x=100; img.body.velocity.y=100; img.body.collideWorldBounds = true; img.body.bounce.set(1); img.anchor.setTo(0.5, 0.5);}function update() { }style.css body { background: #000000; width:100%}h1{ color: #ffffff; text-align: center;}/*center canvas*/canvas { margin: auto; }
×
×
  • Create New...