Category: Computer Technology

Instagram Surpasses Pede Will Facebook As the World’s Largest

Instagram skyrocketed in popularity as more and share photos via a mobile application. As a start-up which is very expensive purchased by Facebook apparently did not make Instagram lose ambition. Instagram sure will be bigger than Facebook.

Facebook now has 1.1 billion users worldwide making it the largest social networking Worldwide. But they have a problem with the new user to hook a young age began to look at other services. In terms of feeling confident that Instagram can grow large if it is capable of growth right now.

“By definition, if Instagram continues to grow in this position then yes, it would be even greater,” said Kevin Systrom in an interview with Fast Company. “Instagram will be the largest in the world.”

In contrast to the explicitly Kevin so confident, Instagram founder fellow replied diplomatically. “I do not know, but it’s a good question. Basically there is no limit to the number so maybe one day we will match?” Mike Krieger said.

Instagram is currently still far less than Facebook, but the number of users has exceeded Twitter. While the video recording feature that was recently launched is also more popular than Twitter’s Vine has attended first.


Facebook offers the dummy’s guide to mobile advertising

Facebook Inc’s mobile advertising success offers a ray of hope for Internet companies trying to make money within the confines of the smartphone’s small screen.

The social network’s 75 percent surge in mobile ad revenue in a span of just three months not only doused skepticism on Wall Street and Madison Avenue about Facebook’s business prospects, some say it could serve as a how-to guide for other Web companies navigating a world where the phone and tablet have fast become the screens of choice.

Facebook’s “Newsfeed” ads, which inject marketing messages straight into a user’s content stream and are tailored for mobile devices, were the stars behind the social network’s stunning numbers on Wednesday.

“You’re going to see a lot of companies transitioning and trying to emulate this model because it’s working so well. That’s why last night was a true watershed moment,” said Ben Schachter, an analyst at Macquarie Research.

Internet company executives have long been concerned that mobile advertising is inherently less lucrative than traditional desktop PC advertising, due to the smartphone’s limited screen size and possible consumer resistance to a flood of ads on their devices.

Companies from Google Inc and Yahoo Inc to upstarts such as Snapchat are searching for the right formula to monetize mobile services. While Google has developed a mobile ad business generating an estimated $10 billion a year in revenue, it remains much smaller and less lucrative than Google’s desktop search advertising. Analysts expect Google to generate $60 billion in annual revenue this year.

That wholesale exploration of “native ads” – or marketing messages intended to blend with a users’ personal content, rather than stand out as an ad – has met with varying success.

Twitter, which pioneered the concept of the in-stream ad even before Facebook, may also be well-positioned to benefit from mobile ads. “Sponsored” messages now pop up abruptly in the middle of streams of tweets, but analysts say the frequency is much lower on Facebook newsfeeds.

More than half of the privately held company’s revenue will come from mobile ads this year, reckons Clark Fredricksen, at industry research firm eMarketer.

Some are just getting into the game. This week, LinkedIn Corp, the network for business professionals, rolled out in-stream ads on mobile and PC versions of its service. Yahoo has experimented with similar types of ads, and acquired blogging hub Tumblr for $1.1 billion in May, in part to jumpstart efforts at developing new formats.

But it’s Facebook, which a year ago had zero mobile revenue, that has most aggressively promoted its mobile advertising business to Madison Avenue – with seeming success.

“Compared to other companies, nobody has come right out and said mobile is our sole focus now,” said Angela Steele, CEO of Ansible, part of advertising holding company IPG. “Facebook put all their eggs in one basket.”

FOLLOWING SUIT

One longstanding question has been how much tolerance consumers have for ads that disrupt their stream of content. Facebook said it has steadily increased the number of ads in the news stream without noticing a drop in user satisfaction.

Facebook Chief Executive Mark Zuckerberg said on Wednesday that, on average, ads now account for 5 percent or one in 20 “stories” in the newsfeed. That ratio could now provide a baseline for calculating success, prompting other Web companies to raise the frequency of ads in their streams.

“It wouldn’t surprise me if other companies would look at that and follow suit,” said Ansible’s Steele.

Hussein Fazal, the CEO of AdParlor, which manages advertising campaigns on Facebook, guesses that the social network must have gradually opened the spigot, gauging user reaction and adjusting the stream all the while.

They seemed to have hit on the right formula, but it’s one that differs across platforms, he said.

“The reason Facebook can do it is, the rest of the content that’s there is so engaging that you don’t mind one out of every 20 ads,” he said. “If you have a newsfeed that’s not so engaging, and you keep seeing ads, then it doesn’t work.”

Plus, the more ads in the stream, the less users will click on them, which can dampen ad prices, he added.

Facebook’s seeming success on mobile devices contrasts with Google’s more gradual improvement in that area. The No. 1 Internet search engine has gradually managed to narrow declines in its overall ad rates from the mobile effect, but last quarter they reversed and went down again, disappointing investors.

Google has avoided news stream ads entirely in its Google+ social network. Instead, its mix of mobile search ads, video ads and innovative formats such as “click-to-call” have delivered what RBC Capital Markets analyst Mark Mahaney estimates is a $10 billion annualized run rate for its mobile business, about four times as much as Facebook.

But mobile has driven down the average cost of Google ads, and some industry watchers consider the transition a long-term threat to the search giant. But other analysts say recent changes to the way it sells ads to marketers, blurring the distinction between the mobile and PC, could help bolster rates.


Acer Launches Aspire Z3 AiO PC-605 with 23 inch Full HD Screen

Taiwanese electronics company, Acer has just introduced its PC all-in-one new, the Acer Aspire Z3-605. AiO PC this one was relying on a large screen and has a high resolution.

Acer Aspire Z3-605 has a 23-inch touch screen with full HD 1080p resolution. AiO PC offers an Intel Core i3-3227U to support 1TB HDD and 4GB of RAM. In addition, Acer is also preparing AiO PC with Intel Core i5 processor options and 8GB of RAM.

AiO PC was launched with the Windows 8 operating system. This computer also comes with an HDMI port and audio output using the optimized Dolby Home Theater v4 technology. AiO PC is also noted as the first with Harman Kardon speakers. In addition, the computer can also be tilted to the position of 10 to 30 degrees.

Regarding the price, this AiO PCs sold at prices ranging from 699.99 USD or about 7 million dollars.


Compete with Microsoft, Google Destroy Copy Paste Systems

California – Now Google browser users can copy and paste the various forms of documents and slide sheets from Gmail to Google Docs, Sheets, and Slides or otherwise more easily. Unfortunately, to be able to feel the system copy and paste from Google this, the user must have the Chrome browser.
The browser engine giant announced on Wednesday, July 10, 2013 when the company had a massive overhaul copy and paste system. “With Google Docs, Sheets and Slides, Chrome browser users can copy and paste text and images between all documents, spreadsheets or tables, and presentations as well as for different types of files,” Google wrote in his blog. Google claims that copied and pasted the format will remain the same.
Copy and paste system not unlike the way Google copy paste that is commonly used to keyboard shortcuts through or from the right-click menu. Users can also copy images from applications on the computer and insert it directly into the document, spreadsheet or presentation slide.
To compete with Microsoft Officenya Microsoft, Google did provide another alternative for users who do not have the Chrome browser with the web clipboard. However, how to copy and paste his work is not as easy as on the Chrome browser. There are eight steps that need to be done.
First, select the section to be copied. Second, click on the Edit menu, and select Web clipboard. Thirdly, click the Copy to clipboard web. When the user has reached the destination file, the user enters the fourth stage click the Edit menu and select Web clipboard again. Users will see an option that previously be copied.
Fifth, Place the cursor where the user wants to insert content. Sixth, select another Web clipboard from the Edit menu. In the seventh stage, the user will select the parts to be inserted with pilhan various formats, such as plain text or HTML. Finally, select the appropriate format and finish.


WLCGram: Instagram Client Application for Windows Phone

Photo sharing application Instagram has been very popular among users of Android and iOS smart phones. But unfortunately Windows Phone smart phone users still have to wait to be able to use this application, because until recently the Instagram still mum about their plans for this one platform. Nokia itself as the largest WP vendors have expressed their support in order to Instagram coming soon to mobile-phone operating system Windows Phone.
While waiting for the official Instagram app is present, it does not hurt us a peek Instagram client application on Windows Phone, which WLCGram. WLCGram is one of Instagram client on Windows Phone that has capabilities similar to the original Instagram application. Some of the features include are:
filter image
could register
Can view photos on Instagram
Can menshare photos to Instagram
Can search by username or hashtag.
.
Unfortunately, the users of this application have not been able to:
Did comment and like
see video
Menshare to Facebook and Twitter.
and some other weaknesses.
With all its limitations and its advantages, the application is priced at $ 0.99 (approximately Rp. 9800) with the option for free trial for 9 hours in advance.


Share Location, Google Maps Help Increase Accuracy

JAKARTA – Google recognizes that besutannya rudimentary mapping applications. Therefore, the company continues to update and even in this case involve the user. This was stated by Google Indonesia Country Head, Rudy Ramawy.

“That’s when you make the trip? Maybe it’s been accurate. That’s why we have never held a ‘grand launch’ of our products, because the company is aware of updates and updates to keep going” Rudy said while responding to thoughts about the accuracy of the crew Techno Okezone Google Maps in Jakarta , overnight.

“We are aware that our service is not completely perfect, but we continue to make updates. Indonesia with a wide geographical conditions is a challenge to deliver the best service,” he said.

Furthermore, Rudy said that if the Android-based smartphone users to enable or diligently perform ‘share location’, it was very helpful software giant to improve the accuracy of its services. “Of course in this case we appreciate aspects of secrecy,” said Rudy.

“If the big cities such as Jakarta, the accuracy of Google Maps can be relied upon. But if remote areas, we continue to provide the best possible experience. Many ways we are doing, Google Drive one of them,” said Rudy.

Meanwhile, following the Google Maps that can be accessed offline in a number of countries, Indonesia Google promised that the service would go in Indonesia, but companies are reluctant to disclose when exactly the service that can be enjoyed.

“A number of countries able to access Google Maps offline, and Indonesia are also included in the list will receive the service. Certainty but we do not know yet,” alluded Country Marketing Manager for Google Indonesia Krishna Zulkarnain.


Make Cold, LED fan from Cooler Master to PC

TAIWAN – Taiwanese hardware device manufacturers, Cooler Master, announced a cooling fan for the latest PC devices. JetFlo called 120, the fan who appeared with LED lights, measuring 120 mm.

Reported TomsHardware, Sunday (07/07/2013), what makes a ‘beautiful’ This device is not only visible from their physical appearance, but rather clever features embedded in it. JetFlo 120 is equipped with Smart Jam Protection feature, so that the system can detect if there are objects blocking the rotation of the fan.

Thus, the system automatically stops the fan rotates to prevent damage. Once the foreign body is no longer interrupt rotation of the fan, then the system will operate normally again.

Design with 120 mm fan can spin at speeds from 800 to 2000 RPM (Revolutions per minute) and a PWM (Pulse-width modulation) control. Fans can push up to 95 CFM and has a noise level to 26 dBA.

Cooler Master claims that its product is the first premium LED fan that will circulate in the market. The company emphasizes three main points on JetFlo 120, the ‘Performance’, ‘Style’ and ‘Silence’.

MTBF fan technology is claimed to be able to run for 160 thousand hours. JetFlo 120 will come with four different colors, including red, black, white and blue.

Reportedly, JetFlo 120 will sell for $ 20 and are available in mid-July 2013.


Creating a 3D Game With Three.js and WebGL

Prerequisites

  • A browser with WebGL – this game has been tested on Chrome and Firefox. IE still doesn’t support WebGL, unless you’re using Windows 8.1 with IE11.
  • Three.js library available for download from the Three.js website
  • The Keyboard.js helper library I used for this project, created by Arthur Schreiber at No Karma. Download it from my GitHub repository
  • A basic understanding of what Three.js does. Read this super simple, super quick tutorial by Paul Lewis. It’s basically a short-hand version of this article.

Setup

Get a base index.html running

Step one when making a web-based game is to create the host index.html file. In our case, it only needs to be a very simple set of elements, so we can bundle the CSS styling too.

Import Keyboard.js and Three.js

Three.js is a library contained in just one JavaScript file, so we can grab the minified version from the website.

For Keyboard input, we will need to referencethe aforementioned JavaScript file in our index.html as well.

Create setup() and draw() functions

The setup() function will be the start point for the game code. The draw() function will be run every frame and will handle all the rendering and game logic.

In order to loop the draw() function, we simply utilise the requestAnimationFrame() function call, and pass ‘draw’ as the parameter. Remember, not all browsers natively support the call, and you might have to use Paul Irish’s shim to gain maximum compatibility. Also, it is important to realise that requestAnimationFrame() does not guarantee a fixed frame-rate, so you need to use time-deltas to calculate realistic physics. For a basic game like Pong, we don’t really care about that.

Basic World

Set up the Three.js world and camera

Three.js includes these important elements:

  • Scene
  • Renderer
  • Camera
  • Mesh
  • Light
  • Material

Cameras, Meshes, and Lights need to be added to the scene using the scene.add() function.

Attach a WebGL Three.js Renderer to the DIV

The renderer is attached to whichever HTML DOM element you wish to render the scene to, and a render() call is made each frame to the renderer in order to draw the Three.js scene.

Add a camera to the scene

Three.js has the option to create Perspective and Orthographic cameras. For most uses, Perspective camera is the best choice. We can change position and rotation information of the camera like any other object in the scene.

Draw a sphere and light it

Meshes must be paired with Materials in order to give them a defined look and feel. Meshes can be of many types, include primitives such as Cube, Sphere, Plane and Torus. Materials can have different characteristics depending on their type. The basic Material types include Lambert, Phong, and Basic.

  • Basic renders an unlit Mesh with no shadows or dark shading. A sphere will look like a circle if rendered with Basic.
  • Lambert is a simple diffuse-like lighting that creates shading on sides facing away from a light source. It gives a basic 3D look of surfaces that are matte (non-shiny and non-reflective)
  • Phong is used for achieving a plastic-like look and feel, with the ability to gain highlights that give a much shinier appearance to the Mesh.

Show off your sphere with a Point Light. This is the most basic light, with no direction or rotation. Make sure you tweak the light’s intensity and distance to get it looking good.

Add Game Objects

Draw playing area plane

The playing area will be a Three.js Mesh object of type Plane. Make sure the plane matches the play area, giving a small buffer gap to indicate where the paddles can and can’t go.

Draw paddles

The paddles will be Mesh objects of type Cube. Position each of the paddles on opposite sides of the play area.

1234567891011121314151617181920212223242526272829303132333435363738394041
// set up the paddle vars
paddleWidth = 10;
paddleHeight = 30;
paddleDepth = 10;
paddleQuality = 1;
// set up paddle 1
paddle1 = new THREE.Mesh(
new THREE.CubeGeometry(
paddleWidth,
paddleHeight,
paddleDepth,
paddleQuality,
paddleQuality,
paddleQuality),
paddle1Material);
// add the paddle to the scene
scene.add(paddle1);
// Set up the second paddle
paddle2 = new THREE.Mesh(
new THREE.CubeGeometry(
paddleWidth,
paddleHeight,
paddleDepth,
paddleQuality,
paddleQuality,
paddleQuality),
paddle2Material);
// Add the second paddle to the scene
scene.add(paddle2);
// set paddles on each side of the table
paddle1.position.x = -fieldWidth/2 + paddleWidth;
paddle2.position.x = fieldWidth/2 – paddleWidth;
// lift paddles over playing surface
paddle1.position.z = paddleDepth;
paddle2.position.z = paddleDepth;
view rawBNG_Pong_paddlecreateThis Gist brought to you by GitHub.

If you manipulate the camera positions, as seen in the screenshot, you can give a different perspective to the player.

Basic Logic

Ball movement

The ball will have an X-direction and a Y-direction that determines the movement per frame.

// ball’s x-direction, y-direction and speed per frame
var ballDirX = 1, ballDirY = 1, ballSpeed = 2;

The ball will move at a constant speed in the X-plane every frame. To this end, we will specify a ballSpeed variable that acts as a multiplier for the direction values.

// update ball position over time
ball.position.x += ballDirX * ballSpeed;
ball.position.y += ballDirY * ballSpeed;

We want the ball to have some unpredictable characteristics (e.g. when it gets sliced quite hard) so we will allow the Y-direction to go up to a maximum of ballSpeed * 2. You can tweak the values until you’re happy with how the ball behaves.

// limit ball’s y-speed to 2x the x-speed
// this is so the ball doesn’t speed from left to right super fast
// keeps game playable for humans
if (ballDirY > ballSpeed * 2)
{
ballDirY = ballSpeed * 2;
}
else if (ballDirY < -ballSpeed * 2)
{
ballDirY = -ballSpeed * 2;
}

Ball wall bounce logic

Simple collision detection logic is required to check if the ball is touching each of the side ‘walls’. Using a series of ‘if-else’ statements, we check the ball positions against the predetermined wall positions. In the case of a collision, we simply switch the Y-direction of the ball, creating a bounce effect.

// if ball goes off the top side (side of table)
if (ball.position.y <= -fieldHeight/2)
{
ballDirY = -ballDirY;
}
// if ball goes off the bottom side (side of table)
if (ball.position.y >= fieldHeight/2)
{
ballDirY = -ballDirY;
}

Later, we will edit some of this code in order to implement scoring when the ball passes a paddle.

Keyboard input for paddles

We will utilise a very effective short-cut in order to easily get keyboard input working in this game. Using the Keyboard.js file provided, we simply have to include the reference to it in the index.html file and we are set. Only one function call is required, the Key.isDown() call. Given a parameter, the library checks if that particular key is current being pressed, and returns a boolean value.

// move left
if (Key.isDown(Key.A))
{
// code to move paddle left
}

We use the ‘A’ and ‘D’ keys to move the paddle left and right, but you can edit the Keyboard.js with additional values if you want to use your own control scheme.

var Key = {
_pressed: {},
A: 65,
W: 87,
D: 68,
S: 83,
// add your required key code (ASCII) along with the name here
// for example:
SPACE: 32,
};

While dealing with keyboard input, it is also important to ensure that the input is never blindly updated in game. We have to check that the paddle isn’t made to move off the play area, and we do that with some ‘if-else’ statements as well.

// move left
if (Key.isDown(Key.A))
{
// if paddle is not touching the side of table
// we move
if (paddle1.position.y < fieldHeight * 0.45)
{
paddle1DirY = paddleSpeed * 0.5;
}
// else we don’t move and stretch the paddle
// to indicate we can’t move
else
{
paddle1DirY = 0;
paddle1.scale.z += (10 – paddle1.scale.z) * 0.2;
}
}

Note that we use a paddle direction variable, rather than simply applying a change to the position values. This will come in handy when programming the ball to ‘slice’ when hit at an angle with a fast-moving paddle.

Opponent logic

When you code a game of this calibre, it is of utmost importance that you create a vivid, lush environment with a host of emotional, highly-relatable characters that showcase this generation’s strides forward in technology. Instead, we will code a Pong A.I. that blindly follows the ball, because that is even better.

We can update the opponent difficulty by using a variable instead of introducing magic numbers. This variable will affect the ‘reaction rate’ of the opponent by increasing the Lerp (Linear-Interpolation) time.

When using a Lerp (Linear-Interpolation) function, we must ensure the opponent plays fairly by limiting their maximum travel speed. We do that with a few more if-else statements.

// in case the Lerp function produces a value above max paddle speed, we clamp it
if (Math.abs(paddle2DirY) <= paddleSpeed)
{
paddle2.position.y += paddle2DirY;
}
// if the lerp value is too high, we have to limit speed to paddleSpeed
else
{
// if paddle is lerping in +ve direction
if (paddle2DirY > paddleSpeed)
{
paddle2.position.y += paddleSpeed;
}
// if paddle is lerping in -ve direction
else if (paddle2DirY < -paddleSpeed)
{
paddle2.position.y -= paddleSpeed;
}
}
If want to extend immersion, you could also using the paddle.scale property to stretch the paddle when it can’t be moved. This indicates an issue to the player which they can then address immediately. In order to accomplish this, we must ensure the paddle always Lerps back to the default scale size.
// We lerp the scale back to 1
// this is done because we stretch the paddle at some points
// stretching is done when paddle touches side of table and when paddle hits ball
// by doing this here, we ensure paddle always comes back to default size
paddle2.scale.y += (1 – paddle2.scale.y) * 0.2;

Adding Gameplay

Making the ball reset after missing a paddle

To get the main scoring gameplay working, we need to first remove the ball’s ability to bonce off the paddle-facing walls. To do this, we remove the bounce code from the two corresponding if-else statements.

// if ball goes off the top side (side of table)
if (ball.position.y <= -fieldHeight/2)
{
ballDirY = -ballDirY;
}
// if ball goes off the bottom side (side of table)
if (ball.position.y >= fieldHeight/2)
{
ballDirY = -ballDirY;
}
//// ——————————— ////
CHANGED CODE
//// ——————————— ////
// if ball goes off the ‘left’ side (Player’s side)
if (ball.position.x <= -fieldWidth/2)
{
// CPU scores a point
// update scoreboard
// and reset ball
}
// if ball goes off the ‘right’ side (CPU’s side)
if (ball.position.x >= fieldWidth/2)
{
// player scores a point
// update scoreboard
// and reset ball
}

We can handle scoring in many different ways. For a simple game like this, we can simply increment the corresponding score count variable.

// if ball goes off the ‘left’ side (Player’s side)
if (ball.position.x <= -fieldWidth/2)
{
// CPU scores
score2++;
// update scoreboard HTML
document.getElementById(“scores”).innerHTML = score1 + “-” + score2;
// reset ball to center
resetBall(2);
// check if match over (someone scored maxScore points)
matchScoreCheck();
}

We can then update the HUD element in the DOM by setting its innerHTML value. Finally, we have to reset the ball once someone has scored. A simple function can be written to reset the ball, with a parameter indicating which paddle just lost (so we know which paddle to send the ball to next time).

// resets the ball’s position to the centre of the play area
// also sets the ball direction speed towards the last point winner
function resetBall(loser)
{
// position the ball in the center of the table
ball.position.x = 0;
ball.position.y = 0;
// if player lost the last point, we send the ball to opponent
if (loser == 1)
{
ballDirX = -1;
}
// else if opponent lost, we send ball to player
else
{
ballDirX = 1;
}
// set the ball to move +ve in y plane (towards left from the camera)
ballDirY = 1;
}

Making the ball bounce off paddles

Alright, this is it. The big one. Literally the biggest feature of this game. It’s time to get the paddles hitting the ball. In a simple Pong game, paddle-ball physics are nothing more than a couple of if-else statements. We check the X-position and Y-position of the ball against the paddle’s rectangular bounds, and if they intersect, we bounce the ball away.

// if ball is aligned with paddle1 on x plane
// remember the position is the CENTER of the object
// we only check between the front and the middle of the paddle (one-way collision)
if (ball.position.x <= paddle1.position.x + paddleWidth
&& ball.position.x >= paddle1.position.x)
{
// and if ball is aligned with paddle1 on y plane
if (ball.position.y <= paddle1.position.y + paddleHeight/2
&& ball.position.y >= paddle1.position.y – paddleHeight/2)
{
// ball is intersecting with the front half of the paddle
}
}

It’s also important to check the direction of the ball’s travel, as we only want to check collisions in one direction (the direction towards the opponent.)

// and if ball is travelling towards player (-ve direction)
if (ballDirX < 0)
{
// stretch the paddle to indicate a hit
paddle1.scale.y = 15;
// switch direction of ball travel to create bounce
ballDirX = -ballDirX;
// we impact ball angle when hitting it
// this is not realistic physics, just spices up the gameplay
// allows you to ‘slice’ the ball to beat the opponent
ballDirY -= paddle1DirY * 0.7;
}

We will also affect the ball’s lateral movement depending on the relative speed of the paddle when hitting the ball. This is particularly useful in introducing the biggest variable in Pong: the slice. Slicing the ball is often the only way to confuse and outmaneuver the opponent, so it is vital in this game.

Remember to duplicate the code, but update the values to match the opponent’s paddle. You can use this opportunity to gimp your opponent’s ability somewhat, by reducing the hitbox size or decreasing the slice amount. It’s what we would all do.

Here is the final paddle-ball collision function:

// Handles paddle collision logic
function paddlePhysics()
{
// PLAYER PADDLE LOGIC
// if ball is aligned with paddle1 on x plane
// remember the position is the CENTER of the object
// we only check between the front and the middle of the paddle (one-way collision)
if (ball.position.x <= paddle1.position.x + paddleWidth
&& ball.position.x >= paddle1.position.x)
{
// and if ball is aligned with paddle1 on y plane
if (ball.position.y <= paddle1.position.y + paddleHeight/2
&& ball.position.y >= paddle1.position.y – paddleHeight/2)
{
// and if ball is travelling towards player (-ve direction)
if (ballDirX < 0)
{
// stretch the paddle to indicate a hit
paddle1.scale.y = 15;
// switch direction of ball travel to create bounce
ballDirX = -ballDirX;
// we impact ball angle when hitting it
// this is not realistic physics, just spices up the gameplay
// allows you to ‘slice’ the ball to beat the opponent
ballDirY -= paddle1DirY * 0.7;
}
}
}
// OPPONENT PADDLE LOGIC
// if ball is aligned with paddle2 on x plane
// remember the position is the CENTER of the object
// we only check between the front and the middle of the paddle (one-way collision)
if (ball.position.x <= paddle2.position.x + paddleWidth
&& ball.position.x >= paddle2.position.x)
{
// and if ball is aligned with paddle2 on y plane
if (ball.position.y <= paddle2.position.y + paddleHeight/2
&& ball.position.y >= paddle2.position.y – paddleHeight/2)
{
// and if ball is travelling towards opponent (+ve direction)
if (ballDirX > 0)
{
// stretch the paddle to indicate a hit
paddle2.scale.y = 15;
// switch direction of ball travel to create bounce
ballDirX = -ballDirX;
// we impact ball angle when hitting it
// this is not realistic physics, just spices up the gameplay
// allows you to ‘slice’ the ball to beat the opponent
ballDirY -= paddle2DirY * 0.7;
}
}
}
}
view rawBNG_Pong_paddlecollCompleteThis Gist brought to you by GitHub.

Scoring

In Pong, it is usually simplest to have a maximum score value, such that a game is won when either player reaches that score. To that end, we can easily create a maxScore variable and set it at the start of the match.

We then create a function to check if either player has scored equal or higher than the maximum. This function should be called only when a score has been changed (i.e. when someone scores a point.)

// checks if either player or opponent has reached 7 points
function matchScoreCheck()
{
// if player has 7 points
if (score1 >= maxScore)
{
// stop the ball
ballSpeed = 0;
// write to the banner
document.getElementById(“scores”).innerHTML = “Player wins!”;
document.getElementById(“winnerBoard”).innerHTML = “Refresh to play again”;
}
// else if opponent has 7 points
else if (score2 >= maxScore)
{
// stop the ball
ballSpeed = 0;
// write to the banner
document.getElementById(“scores”).innerHTML = “CPU wins!”;
document.getElementById(“winnerBoard”).innerHTML = “Refresh to play again”;
}
}

After a match is deemed complete, it is simplest to just return the ball to the centre and stop any movement, so that play doesnt inadvertently continue.

Prettifying the Game

HUD

It’s important to give feedback to the player so they know what’s going on. For Pong, the least we can do is keep a scoreboard ticking over. Instead of trying to draw the HUD on the same layer as the game, we can use the other DOM elements to provide the required feedback.

It’s also good to indicate the maximum score as well, so we have another element for that which we will update at match start.

// update the board to reflect the max score for match win
document.getElementById(“winnerBoard”).innerHTML = “First to ” + maxScore + ” wins!”;

Shadows

Finally, it is time to make things look a tad more polished. Three.js has the awesome ability to create shadows for primitive objects (Cube, Plane, Sphere, etc.) so we can utilise that to make the game look nicer.

Shadows can’t be created with just a Point light, so we have to add a DirectionalLight or a SpotLight. A SpotLight shines a circular beam of light onto surfaces, which DirectionalLight simply shines a light in a certain direction with no regard to positioning.

We will use a SpotLight because it clearly indicates where the light originates from and shines towards.

We can update the SpotLight to follow the ball around to give a more dynamic look and feel to the game, whilst showcasing the hard work we just put into the lighting.

// we can easily notice shadows if we dynamically move lights during the game
spotLight.position.x = ball.position.x;
spotLight.position.y = ball.position.y;

To make an object in the scene cast or receive shadows, we simply set their .receiveShadow and .castShadow variables to true. For example,

paddle1 = new THREE.Mesh(
new THREE.CubeGeometry(paddleWidth, paddleHeight, paddleDepth, paddleQuality, paddleQuality, paddleQuality),
paddle1Material);
// add the sphere to the scene
scene.add(paddle1);
paddle1.receiveShadow = true;
paddle1.castShadow = true;

Conclusion

This is but a basic introduction to the power of Three.js, which should allow you to create a basic Pong clone.

Play the latest build of this game here: LATEST BUILD*

Find the latest code at its GitHub page*

You can still do quite a number of things to polish your game, such as

  • Create animations for the paddles and ball
  • Update the HUD to look prettier
  • Import complex objects created in Modeling packages, to design a more immersive environment
  • Move HUD elements inside the game view to allow for full-screen gaming
  • Mess around with complex shaders to create reflections and other cool effects

Lenovo IdeaCentre A520 Touch, slim AIO PC

Jakarta, (ANTARA News) – IdeaCentre A520 Touch will soon become a mainstay of Lenovo Indonesia to dominate the market “all-in-one (AIO) desktop PC” in Indonesia with a sleek design and space-saving and very flexible angle capability.

Products launched in Jakarta on Tuesday afternoon it has the same appearance as its predecessor product, the IdeaCentre A720 Touch, which won many awards. What distinguishes the IdeaCentre A520 IdeaCentre A720 Touch Touch is a 23-inch full HD screen without a frame.

IdeaCentre A520 Touch that supports the “10-point multi-touch” screen that has a wide angle that can be adjusted, from minus five degrees to 90 degrees, and IPS LED with a picture perfect view from any angle.

Flexibility IdeaCentre A520 Touch screen allows users to watch movies, play touch-based games or enjoy video chat in any position.

IdeaCentre A520 Touch also comes with an Intel Core i5 processor up to the third generation of the Intel HD Graphics 4000 and 4 Gigabyte DDR3 memory.

The products also have additional features such as Dolby certified speakers with Dolby Home Theater v4, various multimedia applications and games that are optimized for the touch screen.

In addition Touch IdeaCentre A520, Lenovo IdeaCentre B540 Indonesia also launched Touch, a home entertainment center with a 23-inch screen, and the IdeaCentre C540 Touch an affordable and efficient place to use at home.


Apple Developer Website Online Again Following Cyberattack

Apple’s developer website was back online Friday, more than a week after it was targeted by a hacker who reportedly attempted to steal personal information, various media outlets have reported.

According to Bloomberg’s Jordan Robertson, the website used by engineers who write Mac and iOS device applications was said to be active as of 5pm Pacific time on July 26. The attack had forced it offline for a total of eight days.

“Developers use the site for software downloads, documentation and engineering information,” Robertson said. “The maker of iPhones and iPads said this week that it’s ‘completely overhauling’ its developer systems to prevent a security threat from happening again. While some of the website’s information was encrypted, Applesaid it hadn’t been able to rule out whether names, mailing addresses or e-mail addresses may have been accessed.”

The website targeted by the cyberattack is used by the Cupertino, California-based tech giant to communicate with its community of nearly six million software developers, according to Reuters reporter Aman Shah. A UK-based Turkish researcher named Ibrahim Balic has claimed responsibility for the attack, which he says was not malicious in nature, but not everyone buys his story.

“Balic, who describes himself as a security consultant, claimed on Sunday that he had discovered a number of weaknesses in the site at developer.apple.com which allowed him to grab email addresses of registered developers,” Guardian reporter Charles Arthur explained. “In all, Balic said he had been able to grab the details of 100,000 people registered on the site, and that he included 73 of them in a bug report to Apple.

“He claimed that he exploited a cross-site scripting (XSS) bug in the site,” he added. “However XSS attacks generally require the attacker – which in this case would be Balic – to ‘infect’ a page with a malicious piece of Javascript or HTML which would then be used to extract data from a visiting user. If Balic’s claim is correct, he seems to have used the XSS exploits against his own system.”

Arthur said they attempted to contact 29 people whose emails were allegedly extracted by Balic during the hacking, but seven of those emails bounced and none of the remaining 22 responded to requests to state whether or not they are registered Apple developers. Furthermore, none of the names or email addresses could be located online, which the Guardian notes would be unusual for active software developers.

“Many of the names and email addresses either don’t look like they would belong to Apple developers, or appear to have left no footprints anywhere else on the net,” added independent security consultant Graham Cluley. In addition, in reference to ten emails featured in a YouTube video created by the alleged hacker, Cluley said, “It’s almost as though these are long-discarded ghost email addresses from years ago or have been used by Balic in his video for reasons best known to himself.”

In related news, a new phishing scam involving Apple has arisen on the heels of the developer website hacking,according to CNET’s Charlie Osborne. Attempting to capitalize on security concerns raised by the cyberattack, the new phishing scam warns users to click on a link in order to change their passwords.

While the email is short, it may appear legitimate to some users, Osborne said. However, it includes a grammar mistake in the title, fails to capitalize Apple on several locations and includes a link that clearly does not lead to a domain registered or owned by the tech giant.

“Users have taken to Twitter to warn others of the phishing attacks, and security firm Kaspersky Lab has found that Apple-related phishing scams have skyrocketed in the last six months, with scammers focused on stealing login credentials and financial data,” the CNET writer added.