| | | | May 7th, 2012 While working with Bloom Lite framework, I have discovered Native Signals – “a new approach for AS3 events, inspired by C# events and signals/slots in Qt.” I have read before, that Events in Flash was slow, but I have also read, that the fastest way to do events is just call required listener (function) directly. And I’ve decided to make my own fast and ugly approach for AS3 events. It has only one class and, I believe, works super fast. It is available for download from GitHub: https://github.com/pozirk/misc, and it’s very easy to use, here is an example: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| ...
public class MyClass extends Eventer
{
public static const MYEVENT:uint = 1;
...
public function myFunc():void
{
if(...) //something happened
fireEvent(MYEVENT, anyObjectHere);
}
}
...
var my:MyClass = new MyClass();
my.addEvent(MyClass.MYEVENT, funcToCall);
...
public function funcToCall(obj:Object):void
{
...
} |
So, any class can extends Eventer class, or just has it as a variable, and each class defines its own events (static IDs), which can be fired. My approach doesn’t have anything like bubbling or capture phases, also there is only one listener possible for every event, but I was aiming for speed and I have thrown away everything and made it as fast as possible. Hope, it will be useful for someone else, although there is nothing special here. no comments | posted in _programming by pozirk May 7th, 2012 As I have decide to develop Cats’n'Rats game using FlashDevelop, I was required to find some kind of GUI framework for my buttons, listboxes, etc. First, I have found Bloom & Bloom Lite – a lightweight and easy to use framework, but it was too basic for me and unintuitive. Later, I have found AsWing, a great framework similar to Java Swing. But it was buggy, at least for me. I could not make it work with absolute positions of controls. Finally, I have found SPAS – Swing Package for ActionScript. Another Swing-like framework, but, luckily, it works fine with absolute position by simply using AbsoluteLyout class. It has such features like GridControl and DropButton (still under development, but work great). The default design and colors don’t look very nice, but it’s ok for now. no comments | posted in Cats'n'Rats by pozirk April 24th, 2012 На UBServers я провёл 5 дней, а потом их сервак упал. Тут я уже ждать не стал и сразу вернулся на DirectSpace, к этому вермени у них уже всё работало. И правильно сделал. Хотя саппорт c UBServers мне клялся, что такие поломки у них бывают оооочень редко, два дня спустя их сервак лёг и лежит до сих пор: We are facing a serious power outage… А пока я сижу на DirectSpace, и пока их VPS’ы на удивление стабильно работают, думаю куда мне переехать. Насколько я понял UBServers, покупает сервак(и) у DataShake и уже продаёт VPS’ы своим клиентам, это что касается US-based VPS’ов. no comments | posted in а теперь по-русски by pozirk April 16th, 2012 Ну и неделька выдалась. В этот вторник сайт стал недоступен. Конечно сначала сапорт хостера отвечал, что через 20 минут всё починят, волноваться не стоит. Но потом отвечать перестали, а на их сайте появилась новость: ” Dear Valued VPS Customers As of about 6:30PM PST on Tuesday April 11th, We’ve been the subject of an unauthorized remote access on multiple VPS nodes. If you are experiencing issues connecting to your VPS, it has likely been involved in this matter. … ”
Куча VPS, хостящихся на DirectSpace.net, лежали. Прождав сутки и почитав WebHostingTalk я понял, что ну нафиг такой сервис, если VPS и подымут, то все данные на нём утеряны, и как позже сообщил саппорт, все контейнеры были потёрты при помощи OpenVZ, видимо теми самыми взломщиками. Хорошо, что каждый понедельник у меня автоматом делался бэкап, главное осталось узнать насколько он хорош, и смогу ли я с него восстановить. Однако, всё прошло гладко, я переехал на UBServers.com и буквально за 2-3 часа полностью восстановил систему. Заодно узнал про такие интересные вещи как Dynamic DNS и Round-robin. Да и вообще, новый VPS оказался лучше прежнего, даже пинг от меня до сервера стал ~50мс, вместо старых ~100мс. Кстати, нашёл бесплатный и вполне удобный uptime monitor. Мониторит до 50 сайтов, раз в 5 минут, если что нет так, может выслать сообщение по мылу или даже смс. Но не тут-то было, в этот же день легли DNS сервера от, наверно самого лучшего регистратора доменов, Internet.bs (чего только стоит их Live Chat саппорт, который спокойно работал и отвечал на мои вопросы 26 декабря (Boxing Day, однако), вот что значит 24/7) и сайт опять стал недоступен. Хотя, починили они всё быстро, где-то за час. Что-то много в последенее время взламывают. В феврале и марте, кто-то нашёл дыру у Mochi, чья реклама крутится в моих играх и подворовал слегка деньжат с аккаунтов пользователей, с моего в том числе. Однако, негодяя выщемили и деньги вернули.  Я уже давно сбился со счёта, сколько раз пытались взломать мой сайт. Спрашивается, нафига. Уважаемые! У меня всего 3 посетителя в день, один из них я, два других – боты MSN и Google. Ну зачем вам мой сайт? Да, WordPress, да куча дырявых плагинов для него понаписано, но сколько уже можно долбиться тупо беря инфу с какого-нить Exploit Database и также тупо пытаясь что-то взломать. Я где-то слышал, что хакеры – люди благородные, ломают только сайты всяких негодяев и копирастов, а я всего лишь игры делаю, в свободное от работа и отдыха время. Да и взлом – дело творческое, а не копи-паст. no comments | posted in а теперь по-русски by pozirk March 28th, 2012 Are you a flash game developer? Do you want to get free traffic to your website? OK, I’ll teach you. Nothing illegal!  It’s all about site-lock version of the game. Usually, code for locking the game looks like that: 1
2
3
4
5
6
7
8
9
10
| if(...) //domain name is correct
{
//let's play the game
...
}
else
{
//show some angry message, or don't show anything at all
...
} |
I do it the same way with one small change: 1
2
3
4
5
6
| ...
else
{
//redirect to the page with the game at your website
try {flash.net.navigateToURL(new URLRequest("http:// www.yourdoamin .com/your-flash-game/"), "_self");} catch(e:Error) {}
} |
Now, if someone host the game somewhere, where it is not supposed to be hosted, it redirects player to your website. And everyone is happy: player can play the game, you get +1 visitor. All my games are available for download and host on other websites, but they come with ads or sponsor’s brandings. Same games can be played at my own website and they don’t have ads. Of course, ads-free version of the game is site-locked. But there are some smart guys, like one from “jeux .com”, who grabbed ads-free version of the game, put it to his website and didn’t even check it. Now, I have +1500 extra visitors per day, mainly from France. Merci, mon cher ami! C’est très gentil.  no comments | posted in _programming by pozirk March 28th, 2012 YouYouwin has recently bought “exclusive” license for almost all my games. I just don’t understand, why they call it “exclusive”. They simply took games “as-is” with all the links and logos, just asked to remove ads and leaderboard. They don’t even require to add their own logo. Of course, the price is low too, the average price was ~$15 per game.  Also, they have added their own ads to the games, and pay %40 commissions to developers. Let’s see, how it’s gonna work. no comments | posted in _general by pozirk March 28th, 2012 Finally, I have started to develop my first multiplayer game. As I’m cheap, it will be peer-2-peer game, so no need to purchase a server. Gameplay is quite simple, there is a room with cats and rats (players) in it, so rats should eat cheese and stay alive, and cats should eat rats and “protect” cheese. no comments | posted in Cats'n'Rats, _announce by pozirk February 22nd, 2012 Can be played here: All-in-One Mahjong. As for now, game has 6 layouts, but I will be adding more from time to time. no comments | posted in All-in-One Mahjong, _release by pozirk February 8th, 2012 Developing new game: All-in-One Mahjong. I would like to make it similar to All-in-One Solitaire, so it will have many games (mahjong layouts) in one. All the layout wills be stored in xml, so it gonna be easy to add them. Here is first screenshot:  no comments | posted in All-in-One Mahjong, _announce by pozirk January 26th, 2012 It’s been awhile… So, I have added Gaps Solitaire to All-in-One Solitaire game. And I’m planning to add at least two more solitaire games: Spider and Free Cell. I have moved website to another hoster, so it took me some days and nights to configure my first self-managed VPS. We are working “hard” on Dolly The Sheep game. There are still not all the graphics ready, but we are making levels already. I think, I will be able to release a couple of smaller games, before we finish with DTS. Here are some videos with gameplay: « go inside » no comments | posted in All-in-One Solitaire, Dolly The Sheep, _general by pozirk | | | | |
| |