Fun project -- can you hook flash? - javascript

So my wife is hooked on playing bejeweled on Facebook. Whenever I watch her play (and she's pretty good) I think man I bet I could write a pretty sweet algorithm that would put up a really good score.
So more than anything, I guess I need to know, if there is anyway to observe the UI hooks in Flash from either in the browser with JavaScript or from outside the browser entirely.

You probably want to look at a different technology to auto play the game. A .NET or Java app can easily auto play the game for you. Your app would have to take screenshots and the app pattern matches to figure out what pieces are which. The app can than fire off the click commands that are needed to play the game.

Related

Stencyl game output, HTML5 or Flash player

i'm making a little web game for work, first time using Stencyl. No mobile support needed, it's a desktop only web game. Stencyl doesn't let me publish to HTML5 though, so I tried doing it old-school, exporting a .swf, but this isn't ideal either because of scalability & such. I'm no HTML wizzkid, so just looking if someone knows how to export to HTML from Stencyl, and otherwise an alternative. Many thanks, friends :)

Best way to code a javascript web game considering variables and portability

I'm coding a basic game in HTML/javascript/CSS and I'm just after some advice on best practice/best way to do it.
I only have a basic knowledge of javascript but it seems easy enough and there's nothing too fancy required in my game.
The game will be relatively simple in that it's mainly menu/screen based; there will be a main menu which the user navigates from, which will open the required screen for them to make in game purchases etc, before returning to the main menu screen.
What I'm trying to work out is whether I should do it as just one page, that dynamically changes as the user makes their choices, or several pages for each of the menu items. The second sounds much 'cleaner' in terms of code and layout, but then I have to pass variables across to each page. Some of this information needs to be secure, so I'm thinking of using HTML5's localStorage or sessionStorage. It seems to work well in Chrome but IE8 doesn't seem to like it during my offline testing, apparently you need to have the file uploaded as it's 'domain' based? I thought the whole 'local' meant it could be done locally!
What I also need to consider is that in the future I'd like to convert this to a Facebook or even mobile app. I believe there are some 'wrappers' available and that you can port it across... is the fact that I'm planning on using multiple pages/localStorage going to affect future portability? Is there another way I should be doing this?
Thanks
I have create a few HTML5 Javascript games, I for one did not purchase any books as you can usually find some good stuff out there on the web, so just do some google searchs for HTML5 canvas game or Javascript Html Game.
The best thing to try and keep in mind is OOP (Object-oriented programming), this really helped me out create my simple games as it just keeps a nice pattern.
But basically what I did was just dive straight in and just code. A good editor is Sublime.
Sorry I couldn't off been much help however, if you take a look at a game I created and view the source files, you may get a good understanding of how to create a game :)
http://canvascode.co.uk/Projects/SpaceDestroyer/spacedestroyer.html
Also you could always pick up Unity which is portable for nearly every system there is :)

How to tell if square reader is encrypted or not

My company purchased an old square reader, the seller claims it is unencrypted. We are trying to develop a web application that uses this reader. The reader is supposed to fire a hard return keypress event after registering a swipe - it has never done that (using javascript event listeners). The only time this reader does anything is using the iOS Square Register app - that app does recognize the reader and the swipe (though it does a terrible job, asking me to 'retry swipe faster' a few dozen times before registering a swipe)
The fact that it only works in the app leads me to believe that this is an encrypted reader. Is there any way to tell if this assumption is correct? Without taking it apart.
Also, any tips on troubleshooting this would also be appreciated.
Thanks
I think you're pretty lucky to even be able to detect anything at all with javascript event listeners as you seem to imply....
Imagine the privacy intrusions we'd have all over (maybe already) if javascript stealthily downloaded from a web site could gain access to your microphone and/or microphone jack as you want to do. It might be possible, but the phone 'ifrastructure' is definitely designed to 'resist' this.
I think you're going to have to write an app that installs with user permissions to access the devices you need - otherwise the mic jack device is unlikely to be available to you.
BTW, credit card stripes are encoded in 7 bit, so if you are getting a string that looks 'encrypted' examine the unaltered string as 7 bit and it'll start making sense.

Language to choose for a board game (flash or HTML5/JS)

I am developing a web based multi-player board game and wondering what the best language for the UI would be? Its a board game similar to Go but a lot simpler.
I have two options flash or the much touted HTML5 with JS. I have to learn both though I have basic knowledge of JS.
The problem with flash is I have to pay for the server component but the UI development could be easier and have a richer look and feel to it. With HTML5 + JS there is no cost involved but the UI development I feel will be clunky and not smooth. This I am not sure. Any experienced devs out there care to give some advice? Are there any particular issues to worry about, look into?
EDIT: Thanks for the comments. I will go with HTML5/JS.
As far as the server side goes, I have not yet decided what to use but want to look into node.js. May be I need to post it to programmers.stackoverflow.com about how it handles load and concurrent users.
Thanks,
Pav
Go with HTML and JS, you said your game was similar to GO, well check out http://govsgo.com/.
The site is written in JavaScript, well there's not much on the front end, the backend is based on Ruby on rails, check out Railscasts #237 (http://railscasts.com/episodes/243-beanstalkd-and-stalker) for some background info on the Ruby part.
You can even do really heavy stuff these days in JavaScript, like multiplayer asteroids (http://bonsaiden.github.com/NodeGame-Shooter/), so a "simple" game like you want to build, shouldn't be problem at all.
HTML5/JS will be less compatible with your audience. A lot of people still have non-compliant browsers.
That being said, HTML5/JS would be more fun I think. :)
http://html5readiness.com/ Provided by Robert Pitt
Is your game meant to be used on the iPhone? If yes, Flash is a no-go, as it is not available on the iPhone.
My vote: HTML5/JS.
Why? Consider:
Flash is fading away. On the other hand, you will enjoy a growing audience for your game (including iPhone, iPad and Android).
Flash is more expensive.
I am confident that you can create any UI in HTML5 that you can in Flash. In fact, and presumed limitations of HTML5 may actually force you to refine your UI in a positive way.
Have you seen Grooveshark since they recreated their entire application in HTML5 instead of Flash? Check it out as a proof of concept.
HTML5/JS is easy.
Flash requires a third party plugin, HTML5 only requires an up to date browser- which requirement is better for the user? Personally, I'd rather update my browser than install a third party plugin.
Since your making a multi-user game flash is the way to go. Multi-user stuff is possible with html5/js but as Chuck says its not available in all the browsers. For the multi-user side of things you can use Red5 (which is free) or SmartFox which is not free if you have more than 100 concurrent users. I built a big project with SmartFox awhile back and I found it really easy to work with. Depending on the simplicity of your game you could roll your own socket server code with a language of your choice.
Flash is pretty hard to learn unless you know Java or classic OO (I could add a lot to that comment). I would go with JS/HTML/CSS. As Chuck said, it would be more fun.
The server is only an issue if you plan to use Flash Interactive Server which is pricey. There are open source alternatives. But you say that as if JS has this built in - it doesn't. If you want real time updates, you'll need a CometD server and those are not easy to implement. I'd go with a short poll regardless of whether it's Flash or JS.

How safe is "the future of browser gaming"?

HTML5 will be widely adopted as a way to design games, is the prediction. But I have my questions about this: how can an online HTML5 game ever be secure?
Let me give you an example: imagine this platform game where you gain badges when you win, for example, an extremely hard level. When you have actually won this badge, a request is made to the server, in order to update your online profile. Isn't it extremely simple for a hacker to just send this request and gain the badge, without playing the actual game? Because:
The client-side source code is visible and impossible to hide
It is possible to execute Javascript from the command-line
I don't see a way to prevent this hacker from gaining his badge... Is there any way to make this game safe?
Yes, if you designed your game like that, it would be very easy to hack. But why is this specific to HTML5? You could do that with any type of game that was written like that. Even with a native desktop game you could still fake the request. The only difference is that faking HTTP requests is easier than reverse-engineering requests made by a desktop game.
The solution would be to add some kind of "validation" to the victory--the actual algorithm would vary from game to game. Maybe have the server track the game's progress while the user is playing. If it were a game of chess, for example, you could send every move to the server and have the moves validated to make sure they work out correctly. This gets more complicated with real-time games, though.
But whatever algorithm you decide to use, it will be defeated. Even the chess validation that I just mentioned could be bypassed: you could just "create" your own valid game of chess and just send the same moves to the server every time, ensuring that the game was valid. (This is assuming that the player is against a computer--having two humans play against each other would make things easier.)
It's no different from any Flash-based game or indeed a game with a downloadable client like World of Warcraft. Anything integral to the game's fairness has to be handled on the server.
One way that HTML5 can be more secure is that you can change it at any time. So let's say you have an AJAX call to provide a user with a reward. You could periodically change the signature of this call, so that 'cheats' would no longer work. Be sure to keep track of players that are still using the old API, and you can penalize the players using the cheats.
No, this won't solve all of your problems, and there are ways the most savvy players will be able to work around this (depending on how elaborate your changes are), but it does provide some way to deal with this, especially if your game requires significant investment. Players may not be willing to risk their progress if they feel like there is a chance they'll be caught. Just make sure you have a clear code of conduct that details punishments for cheating.

Categories