This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check Collision | |
var checkCollision = function(anEnemy) { | |
// check for collision between enemy and player | |
if ( | |
player.y + 131 >= anEnemy.y + 90 && | |
player.x + 25 <= anEnemy.x + 88 && | |
player.y + 73 <= anEnemy.y + 135 && | |
player.x + 76 >= anEnemy.x + 11) { | |
console.log('collided'); | |
// Position player after Collision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
http.createServer((req, res) => { | |
res.writeHead(200, { | |
'Content-Type': 'text/plain' | |
}); | |
res.end('Hello World\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send('Hello Main Page'); | |
}); | |
app.get('/login', function(req, res) { | |
res.send('Login Please'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.send('Hello home page');; | |
}); | |
app.get('/route', function(req, res) { | |
res.send('Hello Router, <img src="/route.png">') | |
}) | |
app.get('/login', function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
app.get('/', function(req, res) { | |
res.send('Hello home page'); | |
}); | |
app.get('/route', function(req, res) { | |
res.send('Hello Router, <img src="/image.jpg" style="width:500px; height:500px;">'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
app.get('/', function(req, res) { | |
res.send('Hello home page'); | |
}); | |
app.get('/dynamic', function(req, res) { | |
var lis = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var path = require('path'); | |
var app = express(); | |
app.locals.pretty = true; | |
app.set('view engine', 'pug'); | |
app.set('views', path.join(__dirname, 'views')); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
app.get('/template', function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
head | |
title= title | |
body | |
h1 Hello Jade | |
ul | |
-for(var i=0; i<5; i++) | |
li coding | |
div= time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/topic', function(req,res){ | |
res.send(req.query.id+' , '+req.query.name); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |