A flutter package for making game levels map like candy crush or similar games using flutter with ability to be horizontal or vertical

Overview

Game Levels Scrolling Map

A package for making game levels map like candy crush or similar games using flutter with ability to be horizontal or vertical

Getting Started

  • This package enables you to build a Game levels map like candy crush with the following features :
    • Option to make it horizontal map or vertical
    • Option to reverse the scrolling start direction
    • Option to add the x,y points positions
    • Option to extract the x,y points positions from asset SVG file or online SVG file

Platform Support

| Android | iOS | MacOS ️| Web ✔️ | Linux ❌️ | Windows ️|

Usage


Step 1 Import package:game_levels_scrolling_map/game_levels_scrolling_map.dart which contain the main widget of the map GameLevelsScrollingMap then Import package:game_levels_scrolling_map/model/point_model.dart which contain the model of points

Step 2 Start adding your points widgets by creating a new List of points and adding widgets to it using the PointModel class

List<PointModel> points = [];
      
for(int i = 0; i<50 ; i++){
  points.add(PointModel(100,Container(width: 40, height: 40, color: Colors.red, child: Text("$i"))));
}

Step 3 Use GameLevelScrollingMap.scrollable widget to build the map

- To make vertical map:
Vertical Map Example

Widget build(BuildContext context) {
  return Scaffold(
    body: Container(
      child: GameLevelsScrollingMap.scrollable(
              "assets/drawable/map_vertical.png",
              direction: Axis.vertical,
              reverseScrolling: true,
              svgUrl: 'assets/svg/map_vertical.svg',
              points: points,)
          ),
        );
}

- To make horizontal map:
Horizontal Map Example

Widget build(BuildContext context) {
  return Scaffold(
    body: Container(
      child: GameLevelsScrollingMap.scrollable(
            "assets/drawable/map_horizontal.png",
            direction: Axis.horizontal,
            svgUrl: 'assets/svg/map_horizontal.svg',
            points: points,)
          ),
        );
}
Issues
  • how to create map_vertical.svg

    how to create map_vertical.svg

    i'm using figma to generate path of the map, but looks like svg generator from figma has different style of generating svg

    here's my svg code from figma

    <svg width="251" height="1656" viewBox="0 0 251 1656" fill="none" xmlns="http://www.w3.org/2000/svg">
    <rect width="251" height="1656" fill="#E5E5E5"/>
    <rect width="375" height="6231" transform="translate(-70 -359)" fill="white"/>
    <path d="M21 1L103 14.5L165 46L214 109.5L240.5 177.5L248 255.5V342.5L204 428L119.5 378V278L94 177.5L6 278V396.5V506.5L30 612.5L96.5 665L204 684L248 768.5L204 848L130.5 877L50 897L1 951.5V1081.5V1192V1295.5V1421.5L94 1411.5V1275.5L144.5 1173.5L168.5 1322L195 1449.5L249.5 1560.5L180 1643.5L40 1655" stroke="black"/>
    </svg>
    
    

    how do you generate those svg from example? thankyou

    opened by nashihu 0
  •  does not work

    does not work

    Warning: Operand of null-aware operation '?.' has type 'ImageInfo' which excludes null.

    • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart'
    • ('/packages/flutter/lib/src/painting/image_stream.dart'). image = frame?.image;
    opened by Mandakhbayar 1
  • Map image

    Map image

    Hello, Sometimes my image for the map is not displayed when loading and appears when I reload.

    the error in the terminal is:

    ======= Exception caught by image resource service ================================================ The following _CastError was thrown by an image listener: Null check operator used on a null value

    When the exception was thrown, this was the stack: #0 _GameLevelsScrollingMapState.imageStreamListenerCallBack (package:game_levels_scrolling_map/game_levels_scrolling_map.dart:225:34) #1 _GameLevelsScrollingMapState._loadImage. (package:game_levels_scrolling_map/game_levels_scrolling_map.dart:202:9) #2 ImageStreamCompleter.setImage (package:flutter/src/painting/image_stream.dart:633:25) #3 MultiFrameImageStreamCompleter._emitFrame (package:flutter/src/painting/image_stream.dart:974:5) #4 MultiFrameImageStreamCompleter._decodeNextFrameAndSchedule (package:flutter/src/painting/image_stream.dart:953:7)

    opened by Gameworl 0
Owner
Mohamed Sayed
Mohamed Sayed
Cute Framework (CF for short) is the cutest framework available for making 2D games in C/C++

Cute Framework (CF for short) is the cutest framework available for making 2D games in C/C++. CF comprises of different features, where the various features avoid inter-dependencies. In this way using CF is about picking and choosing which pieces are needed for your game

null 246 Jul 29, 2022
A single-header C++ library for making simple 2D games

A single-header C++ library for making simple 2D games PLATFORM: Windows LANGUAGE: C++ ENVIRONMENT: Visual Studio Why? Learning C++ is often seen as d

Sumo Digital Academy 45 Aug 5, 2022
This is a list of different open-source video games and commercial video games open-source remakes.

This is a list of different open-source video games and commercial video games open-source remakes.

Ivan Bobev 95 Aug 8, 2022
dos-like is a programming library/framework, kind of like a tiny game engin

dos-like is a programming library/framework, kind of like a tiny game engine, for writing games and programs with a similar feel to MS-DOS productions from the early 90s. But rather than writing code that would run on a real DOS machine, dos-like is about making programs which runs on modern platforms like Windows, Mac and Linux, but which attempts to recreate the look, feel, and sound of old DOS programs.

Mattias Gustavsson 783 Aug 14, 2022
So_Long project is a 2D game that can read/parse any given map.

SO_LONG So_Long project is a 2D game builded with <MLX> that can read/parse any given map. COMPILE cd path/to/SO_LONG && make or for bonus part cd pat

Mhamed Ajjig 2 May 17, 2022
C library for Wordle-like games

libwordle Open this project in 8bitworkshop. This is a C library for making Wordle-like games for 8-bit systems. Platforms supported: C64 (cc65) Wordl

Steven Hugg 4 Jan 31, 2022
🚀 Making multi-player gamedev simpler since 2017

Making multi-player gamedev simpler since 2017. Single-header cross-platform world replication in pure C99. Built with love using zpl • Brought to you

ZPL | Your C11 Powerkit 974 Aug 6, 2022
Open-source, cross-platform, C++ game engine for creating 2D/3D games.

GamePlay v3.0.0 GamePlay is an open-source, cross-platform, C++ game framework/engine for creating 2D/3D mobile and desktop games. Website Wiki API De

gameplay3d 3.8k Aug 11, 2022
Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Storm Devs 640 Aug 11, 2022
C++ Library to connect games with Game Jolt

Game Jolt API C++ Library Game Jolt is a host for free independently developed computer games. As a gamer you are able to play every game on this site

Martin Mauersics 8 Jun 18, 2022
Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Agones is a library for hosting, running and scaling dedicated game servers on Kubernetes. Agones, is derived from the Greek word agōn which roughly t

GoogleForGames 4.7k Aug 8, 2022
A tic-tac-toe game made only in flutter

Tic Tac Toe Game A simple Flutter Tic tac toe game made for educational purpose. the main goal of this project is to teach the importance of data stru

Mouheb Boucherb 21 Jun 20, 2022
Laigter: automatic normal map generator for sprites!

Laigter Overview Download Contributing Screenshots Compiling Linux Windows macOS License Laigter is a tool that automatically generates maps for dynam

null 508 Aug 8, 2022
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World.

OpenXRay OpenXRay is an improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. S

null 2k Aug 10, 2022
Stealthy way to hijack the existing game process handle within the game launcher (currently supports Steam and Battle.net). Achieve external game process read/write with minimum footprint.

Launcher Abuser Stealthy way to hijack the existing game process handle within the game launcher (currently supports Steam and Battle.net). Achieve ex

Ricardo Nacif 78 Aug 12, 2022
Game Boy, Game Boy Color, and Game Boy Advanced Emulator

SkyEmu SkyEmu is low level cycle accurate GameBoy, GameBoy Color and Game Boy Advance emulator that I have been developing in my spare time. Its prima

Sky 193 Aug 6, 2022
A set of libraries and tools to make MSX games using the C programming language.

ubox MSX lib This is a set of libraries and tools to make MSX games using the C programming language. There are three main components: ubox: thin wrap

Juan J. Martínez 42 May 30, 2022
VERY simple cross-platform C++ analytics for games (using Google Analytics)

Tiniest Analytics is a very simple to use, cross-platform (tested on win/osx/linux/ios/android) and basically very tiny analytics system written in C++ (less than 100 lines of code), made specifically for games. It uses libcurl to post events to your Google Analytics account.

Mihai Gosa 95 Jan 31, 2022
Real-time Water - Fast Water Simulation for Games Using Height Fields

In this project a water-simulation was implemented based on the approach suggested in the presentation "Fast Water Simulation for Game

Henrik Patjens 137 Jun 4, 2022