Imagnity Side Scroller

826 views
Skip to first unread message

Scott Ferguson

unread,
Feb 24, 2016, 9:45:23 PM2/24/16
to app-inventor-de...@googlegroups.com
Revised: 20160226:09:16 sf

The images for this game were provided by Sajal Dutta/Ann Peralta from the blog post 'Parallax Design Elements for a 2D Platformer Game' in the Imagnity blog:


I have added some logic for scrolling the images and a few obstacles for a car to jump over.

Update: this project has been tweaked to improve performance

New version: 2

* combined mountains into background - eliminating an image sprite
* cropped the houses and road images in height
* eliminated the 2xmountains image file from the media folder
* using a better wheel image 
* compressed images with tinypng (total images storage is now less than 100k)
* removed lists for components, using advanced blocks slows things too much
* replaced random obstacles to a sequence of unique obstacles (too many dogs were displaying!)
* Houses, Obstacle and Road Headings (180) and Speeds are set in the Designer
* the EdgeReached event blocks are used to test and reset the positions of the Houses and Road ImageSprites
* fix for blocks not positioning correctly
* jump velocity and gravity now adjusted to match device processor speed
* scrolling speed is now more consistent across devices by setting Intervals to 85 ms

---

Screenshot2.png
ImagnitySideScroller.aia

Sajal Dutta

unread,
Feb 25, 2016, 12:38:08 AM2/25/16
to App Inventor Developers Library
The problem using clock is there's no way you can make movement smooth. We will need to use opengl context for games.


On Thursday, February 25, 2016 at 10:45:23 AM UTC+8, Scott Ferguson wrote:
I added some logic to the image assets provided at the following blog post:

http://www.imagnity.com/tutorials/2d-games/parallax-design-elements-for-a-2d-platformer-game/


Scott Ferguson

unread,
Feb 25, 2016, 6:08:00 AM2/25/16
to app-inventor-de...@googlegroups.com
Yes, I agree. That is a problem with App Inventor.
Some of my games work better than others.
Animating characters and scrolling ImageSprites eats up cpu cycles very quickly since MITAI is single-threaded.
Since I am dedicated to working strictly with standard MITAI blocks and wish to avoid using the WebViewer and javascript unless it is absolutely necessary, I generally just consider it a challenge to find workarounds for MITAI's limitations.
I think I can say that I have succeeded somewhat in that regard with this project.
Although it cannot go head-to-head speedwise with javascript or Java games, it is still fun to make and play games made with App Inventor.
---

Sajal Dutta

unread,
Feb 25, 2016, 9:31:33 PM2/25/16
to App Inventor Developers Library
I agree with you Scott. I wish App Inventor added Open GL context for game development. That's the only area I so much love.

Scott Ferguson

unread,
Feb 25, 2016, 10:04:50 PM2/25/16
to App Inventor Developers Library
...and support for sprite sheets
...and a flood fill feature
...and a built-in image editor like Scratch has
...and the ability to add blocks to the language without using Java
...and...and...and...
:-)
---
Reply all
Reply to author
Forward
0 new messages