Hi folks,
This is David Kim from MIT App Inventor. I was thinking about creating some game engine functionality to App Inventor. Our Canvas only has rudimental features for people to create more complicated games
Here are some ideas I had, could people give some feedback on what they think?
-
A real game loop
Add a GameClock or Canvas-level Frame event with deltaTime, pause/resume, target FPS, and actual FPS. Current sprite movement is interval-based per sprite, which makes coordinated game logic awkward. A shared loop lets users update movement, enemies, timers, scoring, and effects in one predictable place. -
Velocity and acceleration properties
Sprites currently expose Speed, Heading, and Interval. For games, users usually want VelocityX, VelocityY, AccelerationX, AccelerationY, maybe AngularVelocity. This makes platformers, top-down movement, gravity, knockback, and projectiles much easier. -
Sprite groups/tags/layers
Add Tag, Group, or Kind to sprites, plus blocks like:-
GetSpritesInGroup("enemy")
-
ForEachSpriteInGroup
-
SetGroupVisible
-
RemoveAllSpritesInGroup
This avoids users manually managing parallel lists of enemies, bullets, coins, etc.
-
-
Dynamic sprite creation
Games need bullets, enemies, coins, particles, pickups, obstacles. Users should be able to clone an ImageSprite template at runtime:-
CreateImageSpriteFrom(template)
-
DeleteSprite(sprite)
-
CloneSprite(sprite)
-
CreateSprite(picture, x, y, width, height)
Without this, complicated games become painful very quickly.
-
-
Better collision options
Current collision is useful, but games need more control:-
collision groups/masks, e.g. bullets collide with enemies but not other bullets
-
CollisionStarted, CollisionEnded, maybe CollisionWithGroup
-
overlap amount or collision normal
-
bounding-box vs circle vs rotated-box vs pixel-perfect modes
-
IsTouchingGroup("enemy")
-