View Full Version : Game Demo

03-08-2017, 04:14 AM
When I picked up Delphi 2 many many years ago my main goal was to program games. Purely as a hobby as I never intended to program for a living.

For many years I made games using DelphiX and later DanJetX and OmegaDX9. Smart Mobile Studio represents an awesome opportunity to create games and animated graphics for browsers, tablets and phones.

When I decide to make a game is SMS I ran into a few hurdles. So I put together a game demo that solves a number of the challenges that I had.

I have a full report written up here http://forums.smartmobilestudio.com/index.php?/topic/4399-game-demo

However, if you are just wanting to have a quick look then here is live link


06-08-2017, 08:24 AM
- Ran it and there is an issue in Firefox that don't exist in Chrome. There seems to be an invisible wall around the player controlled object and I can't move or shoot farther than it.
- There are only two enemies altogether, but I guess this is by design.

07-08-2017, 04:16 AM
HI De Jean, I was not able to replicate the problem in Firefox - to be certain I updated the build version and made a few other changes - like ship facing down at the start so that I know I am looking at the new application.
All seems to work as expected in chrome and firefox.

The two enemies are hardly enemies they just fly off at an angle - the game demo was purely to have a go at Smart Mobile Studio and see if I can use it to make games - and I can. I have made a couple since this demo - they are both not quite finished but I am loving working with SMS. The familiarity of Pascal with some awesome new features and also the power of css and the canvas. I would highly recommend checking it out.

07-08-2017, 09:27 AM
At my work PC it works properly in Firefox. I'll be sure to check out SMS.

07-08-2017, 03:51 PM
Just tested it out and I experienced the same problem of invisible borders being very close to starting position (not the whole window) same as de_jean_7777 reported. I'm using Google Chrome. But when I refreshed the web page using F5 key the invisible borders disappeared and I could move across the entire window.

After some further testing I noticed that I if I open your link using right click and "Open in new tab" I always end up with invisible borders. But if I open your link normally with left click (still opens a new tab for me) there aren't any invisible borders present.
So I'm assuming that when you open some link in new tab Chrome actually does some re sizing of web window area which then results in smaller game area being set as the web window dimensions are retrieved to quickly.

07-08-2017, 06:18 PM
Thanks for the feedback

I think it has to do with the resizing and when that takes place. I will see about fixing the demo.

11-08-2017, 03:03 PM
Resizing and window dimensions can be handled well across all the main browsers but it's my understanding that it still requires some javascript stub code in order to have predictable/repeatable behaviour across most browsers.

SMS I assume generates Javascript from pascal code - I'm also assuming that it has at least a rudimentary, static Javascript API - an ideal fix might come from altering the javascript API rather than coding around it in the pre-translation pascal code.

for a simple solution, you may want to run a timer that fires every second or so that manually queries and compares the screen dimensions. This way if they're not updated correctly in the normal chain of events on a given browser - it will 'correct' a moment later - this technique is evident on many sites that have elements that seem to be delayed in their re-positioning after a resize.

It's not problematically ideal - but it works - if you delay initial rendering (just black out the window) for a couple of seconds on load - then any 'ugly' snapping of dimensions will be hidden.

11-08-2017, 08:27 PM
The bug was my mistake not SMS. I set the width initially when the form object hadn't been finalized yet. I have moved on. I am converting some of our software to see what works and what is challenging.

Here is a conversion of a game I wrote in 2001 - I have updated it with some newer graphics. The gameplay still needs a bit of tweaking. Typically our games are designed to be completed in about 60-70 seconds.