Comments (10)
There won't be multiple areas in one room. I separate both concepts because I prefer having one thing that deals with object management and another thing that is used for everything else. You could have a Room inherit from Area, or have Area be a mixin that gets injected into Room objects, or you could just have the same object management code for all rooms that you create without an Area object and the same effect would be achieved.
from blog.
Instead of using:
function gotoRoom(room_type, ...)
current_room = _G[room_type](...)
end
and calling if input:pressed('1') then goToRoom('RoomCircle')
why couldn't (or shouldn't) we use:
function goToRoom(roomIndex)
currentRoom = roomIndex
end
which removes the need to pass in the room name as a string and allows us to pass in the name as the variable itself such as if input:pressed('1') then goToRoom(RoomCircle)
?
from blog.
The Moses library from the previous part also includes a UUID function uniqueId()
(also aliased to uid()
), which can optionally take in a template string.
It seems to generate numbers sequentially from 0 (0, 1, 2, 3, ...); I haven't completed the tutorial but can't see why there would be a problem with that.
from blog.
Hi, SSYGEN, can i ask you a question? Why do you abstract the concept "Area"? I think the "Room" can handle gameObjects management, will there be multiple areas in one room?
from blog.
maybe i miss something but when using a = Area:new(room_name)
it gives me an error saying that a
is nil, but when using a = Area(room_name)
it lets me use the update and draw functions. what is wrong? i tried to print everything to see what is wrong but i can't figure it out.
from blog.
First, thanks for your sharing! :)
gotoRoom()
function will be better like this?
function gotoRoom(room_type, room_name, ...)
if current_room and current_room.deactivate then
current_room:deactivate()
end
if rooms[room_name] then
current_room = rooms[room_name]
else
current_room = addRoom(room_type, room_name, ...)
end
if current_room.activate then current_room:activate() end
end
from blog.
Hey, I noticed a typo:
- Create a Stage room that has no Area in it. Create a Circle object that does not inherit from GameObject...
from blog.
That isn't a typo.
from blog.
Isn't it? In answers You say that it is required for Circle
to inherit from GameObject
As required, it inherits from GameObject, receives an area, position and optional arguments as arguments.
Edit: clarification
from blog.
Oh, sorry, I didn't notice that these are two different exercises.
from blog.
Related Issues (20)
- Psychedelics and Finishing Games
- Posting gamedev progress online HOT 1
- Neuroticism in Indie Gamedev HOT 1
- Easy Modes HOT 14
- Hey,
- Making rxi's lite my main text editor HOT 4
- Cancellation-proof automated cyberchains HOT 2
- Personality-led irrational behavior during the coronavirus pandemic HOT 3
- Object Management
- Springs
- Personality Trait Instance Archive
- Arguments on why developers might want to prevent streamers from streaming their game
- New Programming Taxonomies HOT 6
- Substack
- New site
- Borders vs. No Borders
- Game Ideas
- Why 1-based indexing is right for Lua
- Thoughts on making small games
- Why indiedevs shouldn't fear being cancelled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.