搜索插件、代码仓与 APP 分类

game_levels_scrolling_map 封面
插件详情v0.0.7

game_levels_scrolling_map

一个用于使用 Flutter 制作类似糖果粉碎的游戏关卡地图的包,支持横向或纵向布局。

AndroidiOSmacOSWindowsLinux
近 30 天下载
182
喜欢数
83
Pub 分数
120

安装插件

flutter pub add game_levels_scrolling_map

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个专为创建类似糖果粉碎的游戏关卡地图而设计的 Flutter 包,支持水平和垂直滚动布局。它使开发者能够构建交互式、可滑动的关卡网格,非常适合三消或拼图游戏。该包经过性能优化,并可无缝集成到跨多个平台的 Flutter 应用程序中。通过可自定义的网格尺寸和流畅的动画,它简化了引人入胜的关卡导航界面的实现。

适合场景

  • 创建拼图游戏关卡选择器
  • 构建水平或垂直层级导航
  • 实现基于滑动的关卡探索
  • 设计糖果粉碎风格的游戏地图
  • 开发移动游戏进度界面

主要特点

  • 支持水平和垂直滚动
  • 可自定义的网格布局
  • 流畅的动画过渡
  • 跨平台兼容性
  • 与 Flutter 的轻松集成
  • 适用于不同屏幕尺寸的响应式设计

适合对象

  • 拼图游戏开发者
  • 移动游戏创作者
  • Flutter 初学者游戏开发
  • 需要交互式关卡选择的应用
  • 基于网格的导航项目

使用建议

  • 需要理解 Flutter 布局原理
  • 可能需要额外的样式来定制视觉效果
  • 性能取决于网格大小和复杂性
  • 限于基于网格的关卡结构
  • 不适用于非滚动或复杂2D地图

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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++){
  PointModel point = PointModel(100,Container(width: 40, height: 40, color: Colors.red, child: Text("$i")));
  
  /* To make the map scroll to a specific point just make its parameter 'isCurrent' = true like the following which will make the map scroll to it once created*/
  if(i == 20) point.isCurrent = true;
  
  points.add(point);
}

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(
              imageUrl: "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(
            imageUrl: "assets/drawable/map_horizontal.png",
            direction: Axis.horizontal,
            svgUrl: 'assets/svg/map_horizontal.svg',
            points: points,)
          ),
        );
}

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。