background preloader

Gameplay - free 3D game engine

Gameplay - free 3D game engine

Cocos2d-x - CCScrollView - Semi Paging Unlike UIScrollView in iOS, there is no paging in CCScrollView, and this would be inconvenient for those who want to make a stage selection scene like Angry Birds. There are different approaches to achieve the scrolling, or the effect of scrolling. The first one is the false scrolling, by placing buttons on both the left and right of the screens, which users can tap the buttons to navigate the pages. However users cannot scroll by dragging, which is a more direct reaction when people want to scroll. The second one is to show up a native scroll view(iOS: UIScrollView - Android: ScrollView) on top of a CCLayer. The method gives full functionality of scrolling and paging. The third one is to modify the code of CCScrollView a bit to achieve the paging functionality. To have paging we need to provide the page size, and also tell the scroll view whether to have the paging effect or not.

3+ Free Must-Have Programming Books For Your Summer Reading List Want to be productive this summer? If your answer is no, I’m surprised you’re reading this article, but since you’re already here, you might as well read about some potentially productive things. Say, reading some great beginner-grade materials especially if you have an interest in making some of your own Chrome extensions, Windows programs, etc. We have published a number of articles with links to programming video tutorials, interactive learning modules, and even our own programming lessons, but sometimes, you might just need a good book to immerse yourself in. Thinking in C++ by Bruce Eckel Thinking in C++ is a free electronic book in its second edition that consists of two volumes. The author of the book also has written various books on Java, Python and more, many of which are available for free from his site. Dive Into HTML5 by Mark Pilgrim Want to make some slick web apps? Eloquent Javascript by Marijn Haverbeke Have you used bookmarklets (you should)?

How to use pthread | Cocos2d-x Now, you can use pthread in cocos2d-x, but there are some limitations. Don’t call any functions which invokes Ref::retain(), Ref::release() or Ref::autorelease(), because AutoreleasePool are not thread-safe. Please refer to Reference Count and AutoReleasePool in Cocos2d-x for more details. If we make retain(), release() and autorealese() thread-safe, then mutex would be required. By the way, OpenGL context is not thread-safe, which you should always keep in mind. cocos2d-x/extensions/network/HttpClient.cpp uses pthread_t and pthread_mutex_t to create network thread. Simple pthread example that shows how to run a function in a separate thread, pass a structure to it and set a mutex:

Making The Web Interactive: An Introduction To jQuery jQuery is a client-side scripting library that nearly every modern website uses – it makes websites interactive. It’s not the only Javascript library, but it is the most developed, most supported, and most widely used. It’s one of the building blocks of any modern website. But what exactly is jQuery, what makes it so popular, and why should you care about it if you’re starting out as a web developer? What Is jQuery? jQuery is an extension of Javascript, a library of Javascript functions and utilities that add visual flair, and make advanced features simple to implement in just a few lines of code. jQuery is built on top of Javascript, but it adds methods and functionality not found in pure Javascript. The main function of jQuery is for DOM manipulation (DOM is the Document Object Model), and it means the underlying structure of any webpage you visit. jQuery is not the only Javascript library out there, but it is the most popular – about 55% of the top 10,000 websites use it. Visual Flair

jQuery Tutorial - Getting Started: Basics & Selectors Last week, I talked about how important jQuery is to any modern web developer and why it’s awesome. This week, I think it’s time we got our hands dirty with some code and learnt how to actually make use of jQuery in our projects. I’ll say this now – you don’t need to learn Javascript in order to use jQuery. Document Object Model jQuery is all about traversal and manipulation of the DOM – the Document Object Model. This simple diagram from w3schools explains the concepts fairly well. Getting Started: Adding jQuery The latest version of jQuery is about 91KB when compressed, so it adds about the same page weight as a small photograph or screenshot. Note however that if you’re running WordPress, this may cause problems because it already has its own copy of the jQuery library. If you add the following line to your functions.php theme file, you’ll add another request for it to be included. wp_enqueue_script("jquery"); $.ajax or $("#header") jQuery("#header") $(‘selector‘).method(); a { } $('a')

JavaScript: A Survey of the Language Douglas Crockford www.crockford.com © 2002 Douglas Crockford This document is an introduction to the JavaScript Programming Language for professional programmers. It is a small language, so if you are familiar with other languages, then this won't be too demanding. JavaScript is not Java. JavaScript is a regular language which won't take much time to learn. When JavaScript was first introduced, I dismissed it as being not worth my attention. JavaScript was developed by Brendan Eich at Netscape as the in-page scripting language for Navigator 2. This document describes ECMAScript Edition 3 (aka JavaScript 1.5). JavaScript contains a small set of data types. Boolean has two values: true and false. Number is 64-bit floating point, similar to Java's double and Double. String is a sequence of zero or more Unicode characters. 'This is a string.' "Isn't this a string? 'A' // The character A "" // An empty string Escapement is done with the \ character, like in Java. var s = "Hello World!" Objects Vars

Getting Started Before diving into JavaScript, it helps to understand how it aligns with the other web technologies. HTML is a markup language used to define and describe content. Whether it be a blog post, a search engine result, or an e-commerce site, the core content of a web page is written in HTML. CSS is a supplemental language that applies style to HTML documents. In the browser, JavaScript adds interactivity and behavior to HTML content. Look at this simple HTML page that includes CSS and JavaScript to see how it all fits together: In the example above, HTML is used to describe the content. JavaScript was originally designed to add interactivity to web pages, not to be a general programming language, which makes it a scripting language. Web BrowserText EditorDeveloper Tools (optional) One of JavaScript's greatest strengths is its simplicity.

Ruby on Rails Tutorial: Learn Rails by Example book and screencasts by Michael Hartl Michael Hartl Contents Foreword My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP (Google me to read about the drama). This book by Michael Hartl came so highly recommended that I had to try it, and the Ruby on Rails Tutorial is what I used to switch back to Rails again. Though I’ve worked my way through many Rails books, this is the one that finally made me “get” it. The linear narrative is such a great format. Enjoy! Derek Sivers (sivers.org) Founder, CD Baby Acknowledgments The Ruby on Rails Tutorial owes a lot to my previous Rails book, RailsSpace, and hence to my coauthor Aurelius Prochazka. I’d like to acknowledge a long list of Rubyists who have taught and inspired me over the years: David Heinemeier Hansson, Yehuda Katz, Carl Lerche, Jeremy Kemper, Xavier Noria, Ryan Bates, Geoffrey Grosenbach, Peter Cooper, Matt Aimonetti, Gregg Pollack, Wayne E. About the author Copyright and license 1.1 Introduction

Related: